SciDAVis  1.D4
Public Types | Public Member Functions | Protected Attributes
PlotToolInterface Class Reference

#include <PlotToolInterface.h>

Inheritance diagram for PlotToolInterface:
DataPickerTool LineProfileTool MultiPeakFitTool RangeSelectorTool ScreenPickerTool TranslateCurveTool

List of all members.

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

Graphd_graph

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

Enumerator:
DataPicker 
ScreenPicker 
LineProfile 
MultiPeak 
RangeSelector 
TranslateCurve 

Constructor & Destructor Documentation

PlotToolInterface::PlotToolInterface ( Graph graph)
inline

References d_graph.

virtual PlotToolInterface::~PlotToolInterface ( )
inlinevirtual

Member Function Documentation

virtual RTTI PlotToolInterface::rtti ( ) const
pure virtual

Member Data Documentation

Graph* PlotToolInterface::d_graph
protected

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