#include <RangeSelectorTool.h>
Public Slots | |
virtual void | pointSelected (const QPoint &point) |
void | setCurveRange () |
void | setEnabled (bool on=true) |
Signals | |
void | changed () |
Emitted whenever the selected curve and/or range have changed. | |
void | statusText (const QString &) |
Public Member Functions | |
void | clearSelection () |
void | copySelection () |
void | cutSelection () |
int | dataSize () const |
virtual bool | eventFilter (QObject *obj, QEvent *event) |
bool | keyEventFilter (QKeyEvent *ke) |
double | maxXValue () const |
double | minXValue () const |
void | pasteSelection () |
RangeSelectorTool (Graph *graph, const QObject *status_target=NULL, const char *status_slot="") | |
virtual int | rtti () const |
QwtPlotCurve * | selectedCurve () const |
void | setSelectedCurve (QwtPlotCurve *curve) |
Caller is responsible for replot. | |
virtual | ~RangeSelectorTool () |
Protected Member Functions | |
virtual void | append (const QPoint &point) |
void | emitStatusText () |
void | setActivePoint (int index) |
Caller is responsible for replot. | |
void | switchActiveMarker () |
Private Attributes | |
QwtPlotMarker | d_active_marker |
int | d_active_point |
bool | d_enabled |
QwtPlotMarker | d_inactive_marker |
int | d_inactive_point |
QwtPlotCurve * | d_selected_curve |
Plot tool for selecting ranges on curves.
As detailed in the documentation of PlotToolInterface, this one is different from most other plot tools in that other tools depend on it. Thus, either RangeSelectorTool should cease to inherit from PlotToolInterface and be renamed to RangeSelector, drawing a clear destinction to the other tools, or the notion of multiple tools being active in parallel and possibly depending on each other should be generalized somehow.
In any case, gathering the code specific to range selection in a seperate class makes Graph/CanvasPicker more manageable; maybe something similar can be done for zooming.
RangeSelectorTool::RangeSelectorTool | ( | Graph * | graph, | |
const QObject * | status_target = NULL , |
|||
const char * | status_slot = "" | |||
) |
RangeSelectorTool::~RangeSelectorTool | ( | ) | [virtual] |
References d_active_marker, PlotToolInterface::d_graph, and d_inactive_marker.
virtual void RangeSelectorTool::append | ( | const QPoint & | point | ) | [inline, protected, virtual] |
References pointSelected().
void RangeSelectorTool::changed | ( | ) | [signal] |
Emitted whenever the selected curve and/or range have changed.
Referenced by clearSelection(), pasteSelection(), pointSelected(), setActivePoint(), and setSelectedCurve().
void RangeSelectorTool::clearSelection | ( | ) |
void RangeSelectorTool::copySelection | ( | ) |
References d_active_point, PlotToolInterface::d_graph, d_inactive_point, d_selected_curve, and Graph::multiLayer().
Referenced by cutSelection().
void RangeSelectorTool::cutSelection | ( | ) |
References clearSelection(), and copySelection().
int RangeSelectorTool::dataSize | ( | ) | const [inline] |
References d_active_point, and d_inactive_point.
void RangeSelectorTool::emitStatusText | ( | ) | [protected] |
References Table::colIndex(), d_active_marker, d_active_point, PlotToolInterface::d_graph, d_inactive_marker, d_selected_curve, Graph::Function, Graph::multiLayer(), statusText(), and Table::text().
Referenced by clearSelection(), pasteSelection(), pointSelected(), setActivePoint(), setSelectedCurve(), and switchActiveMarker().
bool RangeSelectorTool::eventFilter | ( | QObject * | obj, | |
QEvent * | event | |||
) | [virtual] |
References keyEventFilter().
bool RangeSelectorTool::keyEventFilter | ( | QKeyEvent * | ke | ) |
References Graph::curve(), Graph::curveCount(), Graph::curveIndex(), d_active_point, PlotToolInterface::d_graph, d_selected_curve, setActivePoint(), setSelectedCurve(), and switchActiveMarker().
Referenced by eventFilter().
double RangeSelectorTool::maxXValue | ( | ) | const [inline] |
References d_active_marker, and d_inactive_marker.
double RangeSelectorTool::minXValue | ( | ) | const [inline] |
References d_active_marker, and d_inactive_marker.
void RangeSelectorTool::pasteSelection | ( | ) |
References changed(), Table::colIndex(), Table::columnNumericFormat(), d_active_marker, d_active_point, PlotToolInterface::d_graph, d_inactive_marker, d_inactive_point, d_selected_curve, emitStatusText(), Graph::Function, Table::isReadOnlyColumn(), Graph::multiLayer(), Table::notifyChanges(), and Table::setText().
void RangeSelectorTool::pointSelected | ( | const QPoint & | point | ) | [virtual, slot] |
References changed(), Graph::closestCurve(), d_active_marker, d_active_point, PlotToolInterface::d_graph, d_inactive_marker, d_inactive_point, d_selected_curve, emitStatusText(), and setActivePoint().
Referenced by append().
virtual int RangeSelectorTool::rtti | ( | ) | const [inline, virtual] |
Reimplemented from PlotToolInterface.
References PlotToolInterface::Rtti_RangeSelector.
QwtPlotCurve* RangeSelectorTool::selectedCurve | ( | ) | const [inline] |
References d_selected_curve.
void RangeSelectorTool::setActivePoint | ( | int | index | ) | [protected] |
Caller is responsible for replot.
References changed(), d_active_marker, d_active_point, d_enabled, d_selected_curve, and emitStatusText().
Referenced by keyEventFilter(), and pointSelected().
void RangeSelectorTool::setCurveRange | ( | ) | [slot] |
void RangeSelectorTool::setEnabled | ( | bool | on = true |
) | [slot] |
References d_enabled, PlotToolInterface::d_graph, and vizor_xpm.
void RangeSelectorTool::setSelectedCurve | ( | QwtPlotCurve * | curve | ) |
Caller is responsible for replot.
References changed(), d_active_marker, d_active_point, d_enabled, d_inactive_marker, d_inactive_point, d_selected_curve, and emitStatusText().
Referenced by keyEventFilter().
void RangeSelectorTool::statusText | ( | const QString & | ) | [signal] |
Emitted whenever a new message should be presented to the user.
You don't have to connect to this signal if you alreay specified a reciever during initialization.
Referenced by emitStatusText(), and RangeSelectorTool().
void RangeSelectorTool::switchActiveMarker | ( | ) | [protected] |
References d_active_marker, d_active_point, PlotToolInterface::d_graph, d_inactive_marker, d_inactive_point, and emitStatusText().
Referenced by keyEventFilter().
QwtPlotMarker RangeSelectorTool::d_active_marker [private] |
int RangeSelectorTool::d_active_point [private] |
bool RangeSelectorTool::d_enabled [private] |
Referenced by RangeSelectorTool(), setActivePoint(), setEnabled(), and setSelectedCurve().
QwtPlotMarker RangeSelectorTool::d_inactive_marker [private] |
int RangeSelectorTool::d_inactive_point [private] |
QwtPlotCurve* RangeSelectorTool::d_selected_curve [private] |