AvogadroLibs  1.92.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:
BondCentricTool Editor Manipulator MeasureTool Navigator PlayerTool SelectionTool

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=0)
 
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
David C. Lonie

Member Function Documentation

◆ name()

virtual QString name ( ) const
pure virtual

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

Implemented in BondCentricTool, MeasureTool, PlayerTool, SelectionTool, Editor, Manipulator, and Navigator.

◆ description()

virtual QString description ( ) const
pure virtual

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

Implemented in BondCentricTool, MeasureTool, PlayerTool, SelectionTool, Editor, Manipulator, and Navigator.

◆ priority()

virtual unsigned char priority ( ) const
pure virtual

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

Implemented in BondCentricTool, MeasureTool, PlayerTool, SelectionTool, Editor, Manipulator, and Navigator.

◆ activateAction()

virtual QAction* activateAction ( ) const
pure virtual
Returns
The QAction that will cause this tool to become active.

Implemented in BondCentricTool, MeasureTool, PlayerTool, SelectionTool, Editor, Manipulator, and Navigator.

◆ toolWidget()

virtual QWidget* toolWidget ( ) const
pure virtual
Returns
A QWidget that will be displayed to the user while this tool is active.

Implemented in BondCentricTool, MeasureTool, PlayerTool, SelectionTool, Editor, Manipulator, and Navigator.

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

Reimplemented in BondCentricTool, Editor, Manipulator, MeasureTool, Navigator, SelectionTool, and PlayerTool.

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

Reimplemented in BondCentricTool, Editor, Manipulator, MeasureTool, Navigator, SelectionTool, and PlayerTool.

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

Reimplemented in BondCentricTool, Editor, Manipulator, Navigator, and SelectionTool.

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

Reimplemented in BondCentricTool, MeasureTool, Navigator, SelectionTool, and PlayerTool.

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

Reimplemented in Navigator.

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

Reimplemented in Editor, Navigator, and SelectionTool.

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

Reimplemented in Navigator.

◆ draw()

virtual void draw ( Rendering::GroupNode node)
virtual

Override this method to add drawables to the scene graph.

Reimplemented in BondCentricTool, Editor, MeasureTool, and SelectionTool.

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

Implemented in BondCentricTool, MeasureTool, SelectionTool, Editor, Manipulator, and Navigator.

◆ setGLWidget

virtual void setGLWidget ( QtOpenGL::GLWidget )
virtualslot

Set the GLWidget used by the tool.

Reimplemented in BondCentricTool, Editor, and Navigator.

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

Reimplemented in BondCentricTool, Editor, Manipulator, MeasureTool, SelectionTool, and Navigator.


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