Avogadro  1.1.0
Public Slots | Signals | Public Member Functions | Protected Attributes
Avogadro::Tool Class Reference

Interface for tool plugins. More...

#include <avogadro/tool.h>

Inheritance diagram for Avogadro::Tool:
Inheritance graph
[legend]

List of all members.

Public Slots

virtual void setMolecule (Molecule *molecule)

Signals

void message (const QString &m)

Public Member Functions

 Tool (QObject *parent=0)
virtual ~Tool ()
Plugin::Type type () const
QString typeName () const
virtual QActionactivateAction () const
virtual QWidgetsettingsWidget ()
virtual QString settingsTitle () const =0
virtual QUndoCommandmousePressEvent (GLWidget *widget, QMouseEvent *event)=0
virtual QUndoCommandmouseReleaseEvent (GLWidget *widget, QMouseEvent *event)=0
virtual QUndoCommandmouseMoveEvent (GLWidget *widget, QMouseEvent *event)=0
virtual QUndoCommandmouseDoubleClickEvent (GLWidget *widget, QMouseEvent *event)=0
virtual QUndoCommandwheelEvent (GLWidget *widget, QWheelEvent *event)
virtual QUndoCommandkeyPressEvent (GLWidget *widget, QKeyEvent *event)
virtual QUndoCommandkeyReleaseEvent (GLWidget *widget, QKeyEvent *event)
virtual bool paint (GLWidget *widget)
virtual int usefulness () const
bool operator< (const Tool &other) const
virtual void writeSettings (QSettings &settings) const
virtual void readSettings (QSettings &settings)

Protected Attributes

QActionm_activateAction
ToolPrivate *const d

Detailed Description

Interface for tool plugins.

Author:
Donald Ephraim Curtis

This is a template class for tools which manipulate the GLWidget area. The functions they implement are in response to actions performed by the user on the GLWidget.


Constructor & Destructor Documentation

Avogadro::Tool::Tool ( QObject parent = 0)
Avogadro::Tool::~Tool ( ) [virtual]

Destructor


Member Function Documentation

QAction * Avogadro::Tool::activateAction ( ) const [virtual]
QUndoCommand * Avogadro::Tool::keyPressEvent ( GLWidget widget,
QKeyEvent event 
) [virtual]

Response to key press events.

Parameters:
widgetthe GLWidget where the event occurred
eventthe key event information

Referenced by Avogadro::GLWidget::keyPressEvent().

QUndoCommand * Avogadro::Tool::keyReleaseEvent ( GLWidget widget,
QKeyEvent event 
) [virtual]

Response to key release events.

Parameters:
widgetthe GLWidget where the event occurred
eventthe key event information

Referenced by Avogadro::GLWidget::keyReleaseEvent().

void Avogadro::Tool::message ( const QString m) [signal]

Can be used to add messages to the message pane.

Parameters:
mthe message to add to the message pane.
virtual QUndoCommand* Avogadro::Tool::mouseDoubleClickEvent ( GLWidget widget,
QMouseEvent event 
) [pure virtual]

Response to a user double-click

Parameters:
widgetthe GLWidget where the event occurred
eventthe mouse event information
Since:
version 1.1

Implemented in Avogadro::PythonTool.

Referenced by Avogadro::GLWidget::mouseDoubleClickEvent().

virtual QUndoCommand* Avogadro::Tool::mouseMoveEvent ( GLWidget widget,
QMouseEvent event 
) [pure virtual]

Response to mouse movement

Parameters:
widgetthe GLWidget where the event occurred
eventthe mouse event information

Implemented in Avogadro::PythonTool.

Referenced by Avogadro::GLWidget::mouseMoveEvent().

virtual QUndoCommand* Avogadro::Tool::mousePressEvent ( GLWidget widget,
QMouseEvent event 
) [pure virtual]

Response to mouse press

Parameters:
widgetthe GLWidget where the even occurred
eventthe mouse event information

Implemented in Avogadro::PythonTool.

Referenced by Avogadro::GLWidget::mousePressEvent().

virtual QUndoCommand* Avogadro::Tool::mouseReleaseEvent ( GLWidget widget,
QMouseEvent event 
) [pure virtual]

Response to mouse release

Parameters:
widgetthe GLWidget where the even occurred
eventthe mouse event information

Implemented in Avogadro::PythonTool.

Referenced by Avogadro::GLWidget::mouseReleaseEvent().

bool Avogadro::Tool::paint ( GLWidget widget) [virtual]

Called by the GLWidget allowing overlay painting by the tool. Tools get painted last in the overall scheme.

Parameters:
widgetthe GLWidget to paint to

Reimplemented in Avogadro::PythonTool.

Referenced by Avogadro::GLWidget::render().

void Avogadro::Tool::readSettings ( QSettings settings) [virtual]

Read in the settings that have been saved for the tool instance.

Reimplemented from Avogadro::Plugin.

Reimplemented in Avogadro::PythonTool.

Referenced by Avogadro::ToolGroup::readSettings().

void Avogadro::Tool::setMolecule ( Molecule molecule) [virtual, slot]

Called by the parent (normally toolGroup) to tell the tool the underlying model (molecule) has changed

Referenced by Avogadro::ToolGroup::setMolecule().

virtual QString Avogadro::Tool::settingsTitle ( ) const [pure virtual]
Returns:
The translated name of the settings widget

Implemented in Avogadro::PythonTool.

Returns:
The settings widget for the tool.

Reimplemented from Avogadro::Plugin.

Reimplemented in Avogadro::PythonTool.

Plugin::Type Avogadro::Tool::type ( ) const [virtual]

Plugin Type.

Implements Avogadro::Plugin.

Plugin Type Name (Tools).

References QObject::tr().

int Avogadro::Tool::usefulness ( ) const [virtual]

Determines the ordering of the tools. More useful tools are placed first. It is up to the tool designer to be humble about their usefulness value.

Returns:
usefulness value
QUndoCommand * Avogadro::Tool::wheelEvent ( GLWidget widget,
QWheelEvent event 
) [virtual]

Response to mouse wheel movement

Parameters:
widgetthe GLWidget where the event occurred
eventthe mouse wheel event information

Reimplemented in Avogadro::PythonTool.

Referenced by Avogadro::GLWidget::wheelEvent().

void Avogadro::Tool::writeSettings ( QSettings settings) const [virtual]

Write the tool settings so that they can be saved between sessions.

Reimplemented from Avogadro::Plugin.

Reimplemented in Avogadro::PythonTool.

Referenced by Avogadro::ToolGroup::writeSettings().


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