PlotToolInterface Class Reference

`#include <PlotToolInterface.h>`

Inheritance diagram for PlotToolInterface:

## Public Types

enum | RttiValues { Rtti_PlotTool = 0, Rtti_RangeSelector, Rtti_DataPicker, Rtti_TranslateCurveTool, Rtti_MultiPeakFitTool, Rtti_LineProfileTool, Rtti_AddWidgetTool, Rtti_DrawDataPoints, Rtti_ImageProfilesTool, Rtti_SubtractLineTool, Rtti_PlotUserTool = 1000 }

## Public Member Functions

| PlotToolInterface (Graph *graph, const QObject *status_target=NULL, const char *status_slot="")
virtual int | rtti () const
virtual | ~PlotToolInterface ()

## Protected Attributes

Graph * | d_graph
const char * | d_status_slot
const QObject * | d_status_target

## Detailed Description

Interface for tools operating on a Graph.

The basic idea is to have one PlotToolInterface subclass per user-visible tool operating on a Graph, although there may be cases where exceptions to this rule are appropriate. Note that tools can be presented to the user via icons (like DataPickerTool) or via menu entries (like TranslateCurveTool); the basic concept is quite similar. The main point in managing plot tools as subclasses of this class (as opposed to using void pointers) is the virtual destructor that allows tools to clean up after themselves. Additionally, a pointer to the parent Graph (d_graph) is managed. In the future, this class may provide other generic tool functionality.

Note that zooming and range selection are somewhat special in that they can be active in addition to other tools. These are handled as special cases, while all other tools are rendered mutually exclusive by having Graph manage a pointer to the currently active tool (Graph::d_active_tool).

It would be nice for some of the plot tools (like TranslateCurveTool or MultiPeakFitTool) to send a signal when they are finished and to generalize the statusText signal provided by most tools, but having PlotToolInterface inherit from QObject would make it impossible for plot tools to also inherit from other QObject decendants (such as QwtPlotPicker). As a workaround, plot tools can call Graph::setActiveTool(), carefully noting that they are deleted during this call.

Currently, plot tools are instantiated by ApplicationWindow and handed to the Graph in question; this scheme will have to be revised for dynamically adding new tools via plugins.

## Member Enumeration Documentation

enum PlotToolInterface::RttiValues

Enumerator
Rtti_PlotTool |
Rtti_RangeSelector |
Rtti_DataPicker |
Rtti_TranslateCurveTool |
Rtti_MultiPeakFitTool |
Rtti_LineProfileTool |
Rtti_AddWidgetTool |
Rtti_DrawDataPoints |
Rtti_ImageProfilesTool |
Rtti_SubtractLineTool |
Rtti_PlotUserTool |

## Constructor & Destructor Documentation

PlotToolInterface::PlotToolInterface | ( | Graph * | graph,
|  | const QObject * | status_target = `NULL`,
|  | const char * | status_slot = `""`
| ) |  |

inline

References d_graph, d_status_slot, and d_status_target.

virtual PlotToolInterface::~PlotToolInterface | ( |  | ) |

inline virtual

## Member Function Documentation

virtual int PlotToolInterface::rtti | ( |  | ) | const

inline virtual

Reimplemented in ImageProfilesTool, DrawPointTool, RangeSelectorTool, LineProfileTool, DataPickerTool, AddWidgetTool, MultiPeakFitTool, TranslateCurveTool, MultiPeakFitTool, and SubtractLineTool.

References Rtti_PlotTool.

Referenced by ApplicationWindow::clearSelection(), ApplicationWindow::copySelection(), ApplicationWindow::custom2DPlotTools(), ApplicationWindow::cutSelection(), SubtractLineTool::finalize(), MultiPeakFitTool::finalize(), ApplicationWindow::pasteSelection(), Graph::setActiveTool(), ApplicationWindow::showCurveContextMenu(), and ApplicationWindow::showCurveWorksheet().

## Member Data Documentation

Graph* PlotToolInterface::d_graph

protected

Referenced by AddWidgetTool::addEllipse(), AddWidgetTool::addEquation(), AddWidgetTool::addRectangle(), AddWidgetTool::addText(), ScreenPickerTool::append(), DataPickerTool::append(), ImageProfilesTool::append(), DrawPointTool::appendPoint(), LineProfileTool::calculateLineProfile(), RangeSelectorTool::clearMultipleSelection(), RangeSelectorTool::clearSelectedCurve(), ImageProfilesTool::connectPlotLayers(), RangeSelectorTool::copyMultipleSelection(), RangeSelectorTool::copySelectedCurve(), DataPickerTool::DataPickerTool(), RangeSelectorTool::emitStatusText(), AddWidgetTool::eventFilter(), DrawPointTool::eventFilter(), SubtractLineTool::finalize(), MultiPeakFitTool::finalize(), ImageProfilesTool::ImageProfilesTool(), DataPickerTool::keyEventFilter(), RangeSelectorTool::keyEventFilter(), LineProfileTool::LineProfileTool(), RangeSelectorTool::mightNeedMultipleSelection(), ImageProfilesTool::modifiedMatrix(), LineProfileTool::mouseReleaseEvent(), DataPickerTool::movePoint(), MultiPeakFitTool::MultiPeakFitTool(), DataPickerTool::pasteSelection(), RangeSelectorTool::pasteSelection(), DataPickerTool::pasteSelectionAsLayerText(), PlotToolInterface(), RangeSelectorTool::pointSelected(), RangeSelectorTool::RangeSelectorTool(), DataPickerTool::removePoint(), ScreenPickerTool::ScreenPickerTool(), TranslateCurveTool::selectCurvePoint(), TranslateCurveTool::selectDestination(), MultiPeakFitTool::selectPeak(), SubtractLineTool::selectPoint(), RangeSelectorTool::setCurveRange(), RangeSelectorTool::setEnabled(), DataPickerTool::setSelection(), RangeSelectorTool::setVisible(), RangeSelectorTool::showSelectionDialog(), SubtractLineTool::SubtractLineTool(), RangeSelectorTool::switchActiveMarker(), TranslateCurveTool::TranslateCurveTool(), ImageProfilesTool::updateCursorPosition(), ImageProfilesTool::updateCursorWidth(), AddWidgetTool::~AddWidgetTool(), DataPickerTool::~DataPickerTool(), RangeSelectorTool::~RangeSelectorTool(), ScreenPickerTool::~ScreenPickerTool(), and SubtractLineTool::~SubtractLineTool().

const char* PlotToolInterface::d_status_slot

protected

Referenced by PlotToolInterface().

const QObject* PlotToolInterface::d_status_target

protected

Referenced by PlotToolInterface().

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

- qtiplot/src/plot2D/PlotToolInterface.h