SciDAVis
1.D4
|
#include <PlotToolInterface.h>
Public Types | |
enum | RTTI { DataPicker, ScreenPicker, LineProfile, MultiPeak, RangeSelector, TranslateCurve } |
Public Member Functions | |
PlotToolInterface (Graph *graph) | |
virtual RTTI | rtti () const =0 |
virtual | ~PlotToolInterface () |
Protected Attributes | |
Graph * | d_graph |
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.
|
inlinevirtual |
|
pure virtual |
Implemented in LineProfileTool, RangeSelectorTool, TranslateCurveTool, MultiPeakFitTool, ScreenPickerTool, and DataPickerTool.
Referenced by ApplicationWindow::customToolBars().
|
protected |
Referenced by LineProfileTool::addLineMarker(), ScreenPickerTool::append(), DataPickerTool::append(), LineProfileTool::calculateLineProfile(), DataPickerTool::DataPickerTool(), DataPickerTool::end(), MultiPeakFitTool::finalize(), DataPickerTool::keyEventFilter(), RangeSelectorTool::keyEventFilter(), LineProfileTool::LineProfileTool(), LineProfileTool::mouseReleaseEvent(), DataPickerTool::move(), MultiPeakFitTool::MultiPeakFitTool(), PlotToolInterface(), RangeSelectorTool::pointSelected(), RangeSelectorTool::RangeSelectorTool(), DataPickerTool::removePoint(), ScreenPickerTool::ScreenPickerTool(), TranslateCurveTool::selectCurvePoint(), TranslateCurveTool::selectDestination(), MultiPeakFitTool::selectPeak(), DataPickerTool::setSelection(), RangeSelectorTool::switchActiveMarker(), TranslateCurveTool::TranslateCurveTool(), DataPickerTool::~DataPickerTool(), MultiPeakFitTool::~MultiPeakFitTool(), RangeSelectorTool::~RangeSelectorTool(), and ScreenPickerTool::~ScreenPickerTool().