• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kalzium

Avogadro::Tool

Avogadro::Tool Class Reference

#include <avogadro/tool.h>

Inheritance diagram for Avogadro::Tool:

Inheritance graph
[legend]

List of all members.


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.

Definition at line 52 of file src/tool.h.


Public Slots

virtual void setMolecule (Molecule *molecule)

Signals

void message (const QString &m)

Public Member Functions

virtual QAction * activateAction () const
virtual QString description () const
virtual QUndoCommand * mouseMove (GLWidget *widget, const QMouseEvent *event)=0
virtual QUndoCommand * mousePress (GLWidget *widget, const QMouseEvent *event)=0
virtual QUndoCommand * mouseRelease (GLWidget *widget, const QMouseEvent *event)=0
virtual QString name () const =0
bool operator< (const Tool &other) const
virtual bool paint (GLWidget *widget)
virtual void readSettings (QSettings &settings)
virtual QWidget * settingsWidget ()
 Tool (QObject *parent=0)
virtual int usefulness () const
virtual QUndoCommand * wheel (GLWidget *widget, const QWheelEvent *event)=0
virtual void writeSettings (QSettings &settings) const
virtual ~Tool ()

Protected Attributes

ToolPrivate *const d

Constructor & Destructor Documentation

Avogadro::Tool::Tool ( QObject *  parent = 0  ) 

Constructor.

Definition at line 41 of file tool.cpp.

Avogadro::Tool::~Tool (  )  [virtual]

Destructor.

Definition at line 48 of file tool.cpp.


Member Function Documentation

QAction * Avogadro::Tool::activateAction (  )  const [virtual]

Returns:
the QAction of the tool

Definition at line 59 of file tool.cpp.

QString Avogadro::Tool::description (  )  const [virtual]

Returns:
a description of the tool.

Reimplemented in Avogadro::AlignTool, Avogadro::AutoOptTool, Avogadro::AutoRotateTool, Avogadro::BondCentricTool, Avogadro::ClickMeasureTool, Avogadro::DrawTool, Avogadro::ManipulateTool, Avogadro::NavigateTool, and Avogadro::SelectRotateTool.

Definition at line 54 of file tool.cpp.

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

Can be used to add messages to the message pane.

Parameters:
m the message to add to the message pane.

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

Response to mouse movement.

Parameters:
widget the GLWidget where the even occurred
event the mouse event information

Implemented in Avogadro::AlignTool, Avogadro::AutoOptTool, Avogadro::AutoRotateTool, Avogadro::BondCentricTool, Avogadro::ClickMeasureTool, Avogadro::DrawTool, Avogadro::ManipulateTool, Avogadro::NavigateTool, and Avogadro::SelectRotateTool.

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

Response to mouse press.

Parameters:
widget the GLWidget where the even occurred
event the mouse event information

Implemented in Avogadro::AlignTool, Avogadro::AutoOptTool, Avogadro::AutoRotateTool, Avogadro::BondCentricTool, Avogadro::ClickMeasureTool, Avogadro::DrawTool, Avogadro::ManipulateTool, Avogadro::NavigateTool, and Avogadro::SelectRotateTool.

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

Response to mouse release.

Parameters:
widget the GLWidget where the even occurred
event the mouse event information

Implemented in Avogadro::AlignTool, Avogadro::AutoOptTool, Avogadro::AutoRotateTool, Avogadro::BondCentricTool, Avogadro::ClickMeasureTool, Avogadro::DrawTool, Avogadro::ManipulateTool, Avogadro::NavigateTool, and Avogadro::SelectRotateTool.

virtual QString Avogadro::Tool::name (  )  const [pure virtual]

Returns:
the name of the tool.

Implemented in Avogadro::AlignTool, Avogadro::AutoOptTool, Avogadro::AutoRotateTool, Avogadro::BondCentricTool, Avogadro::ClickMeasureTool, Avogadro::DrawTool, Avogadro::ManipulateTool, Avogadro::NavigateTool, and Avogadro::SelectRotateTool.

bool Avogadro::Tool::operator< ( const Tool &  other  )  const

Definition at line 84 of file tool.cpp.

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:
widget the GLWidget to paint to

Reimplemented in Avogadro::AlignTool, Avogadro::AutoOptTool, Avogadro::AutoRotateTool, Avogadro::BondCentricTool, Avogadro::ClickMeasureTool, Avogadro::ManipulateTool, Avogadro::NavigateTool, and Avogadro::SelectRotateTool.

Definition at line 88 of file tool.cpp.

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

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

Reimplemented in Avogadro::AutoOptTool, Avogadro::BondCentricTool, and Avogadro::DrawTool.

Definition at line 98 of file tool.cpp.

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

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

Reimplemented in Avogadro::BondCentricTool.

Definition at line 75 of file tool.cpp.

QWidget * Avogadro::Tool::settingsWidget (  )  [virtual]

Returns:
the settings widget for the tool.

Reimplemented in Avogadro::AlignTool, Avogadro::AutoOptTool, Avogadro::AutoRotateTool, Avogadro::BondCentricTool, Avogadro::DrawTool, and Avogadro::SelectRotateTool.

Definition at line 70 of file tool.cpp.

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

Reimplemented in Avogadro::AutoOptTool, Avogadro::AutoRotateTool, Avogadro::BondCentricTool, Avogadro::DrawTool, Avogadro::ManipulateTool, Avogadro::NavigateTool, and Avogadro::SelectRotateTool.

Definition at line 79 of file tool.cpp.

virtual QUndoCommand* Avogadro::Tool::wheel ( GLWidget *  widget,
const QWheelEvent *  event 
) [pure virtual]

Response to mouse wheel movement.

Parameters:
widget the GLWidget where the even occurred
event the mouse wheel event information

Implemented in Avogadro::AlignTool, Avogadro::AutoOptTool, Avogadro::AutoRotateTool, Avogadro::BondCentricTool, Avogadro::ClickMeasureTool, Avogadro::DrawTool, Avogadro::ManipulateTool, Avogadro::NavigateTool, and Avogadro::SelectRotateTool.

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

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

Reimplemented in Avogadro::AutoOptTool, Avogadro::BondCentricTool, and Avogadro::DrawTool.

Definition at line 93 of file tool.cpp.


Member Data Documentation

ToolPrivate* const Avogadro::Tool::d [protected]

Definition at line 157 of file src/tool.h.


The documentation for this class was generated from the following files:
  • src/tool.h
  • tool.cpp

kalzium

Skip menu "kalzium"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal