AvogadroLibs 1.97.0
Public Slots | Signals | Public Member Functions | List of all members
ToolPlugin Class Referenceabstract

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

#include <avogadro/qtgui/toolplugin.h>

Inheritance diagram for ToolPlugin:

Public Slots

virtual void setMolecule (QtGui::Molecule *mol)=0
 
virtual void setEditMolecule (QtGui::RWMolecule *)
 
virtual void setGLWidget (QtOpenGL::GLWidget *)
 
virtual void setActiveWidget (QWidget *)
 
virtual void setGLRenderer (Rendering::GLRenderer *)
 

Signals

void drawablesChanged ()
 
void updateRequested ()
 

Public Member Functions

 ToolPlugin (QObject *parent=nullptr)
 
virtual QString name () const =0
 
virtual QString description () const =0
 
virtual unsigned char priority () const =0
 
virtual QAction * activateAction () const =0
 
virtual QWidget * toolWidget () const =0
 
virtual void draw (Rendering::GroupNode &node)
 
virtual QUndoCommand * mousePressEvent (QMouseEvent *e)
 
virtual QUndoCommand * mouseReleaseEvent (QMouseEvent *e)
 
virtual QUndoCommand * mouseMoveEvent (QMouseEvent *e)
 
virtual QUndoCommand * mouseDoubleClickEvent (QMouseEvent *e)
 
virtual QUndoCommand * wheelEvent (QWheelEvent *e)
 
virtual QUndoCommand * keyPressEvent (QKeyEvent *e)
 
virtual QUndoCommand * keyReleaseEvent (QKeyEvent *e)
 

Detailed Description

Author
Allison Vacanti

Member Function Documentation

◆ 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.

◆ 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
eThe 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.

◆ mouseReleaseEvent()

virtual QUndoCommand * mouseReleaseEvent ( QMouseEvent *  e)
virtual

Respond to user-input events.

Parameters
eThe 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.

◆ mouseMoveEvent()

virtual QUndoCommand * mouseMoveEvent ( QMouseEvent *  e)
virtual

Respond to user-input events.

Parameters
eThe 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.

◆ mouseDoubleClickEvent()

virtual QUndoCommand * mouseDoubleClickEvent ( QMouseEvent *  e)
virtual

Respond to user-input events.

Parameters
eThe 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.

◆ wheelEvent()

virtual QUndoCommand * wheelEvent ( QWheelEvent *  e)
virtual

Respond to user-input events.

Parameters
eThe 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.

◆ keyPressEvent()

virtual QUndoCommand * keyPressEvent ( QKeyEvent *  e)
virtual

Respond to user-input events.

Parameters
eThe 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.

◆ keyReleaseEvent()

virtual QUndoCommand * keyReleaseEvent ( QKeyEvent *  e)
virtual

Respond to user-input events.

Parameters
eThe 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.

◆ draw()

virtual void draw ( Rendering::GroupNode node)
virtual

Override this method to add drawables to the scene graph.

◆ drawablesChanged

void drawablesChanged ( )
signal

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

◆ updateRequested

void updateRequested ( )
signal

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

◆ setMolecule

virtual void setMolecule ( QtGui::Molecule mol)
pure virtualslot

Called when the current molecule changes.

◆ setGLWidget

virtual void setGLWidget ( QtOpenGL::GLWidget )
virtualslot

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

virtual void setGLRenderer ( Rendering::GLRenderer )
virtualslot

Set the GLRenderer used by the tool.


The documentation for this class was generated from the following file: