DataPickerTool Class Reference

Plot tool for selecting, moving or removing individual points of a curve. More...

`#include <DataPickerTool.h>`

Inheritance diagram for DataPickerTool:

## Public Types

enum | Mode { Display, Move, Remove, MoveCurve }
enum | MoveMode { Free, Vertical, Horizontal }
Public Types inherited from PlotToolInterface
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 Slots

void | pasteSelectionAsLayerText ()

## Signals

void | selected (QwtPlotCurve *, int)
| Emitted whenever a new data point has been selected. More...
void | statusText (const QString &)

## Public Member Functions

ApplicationWindow * | applicationWindow ()
void | copySelection ()
void | cutSelection ()
| DataPickerTool (Graph *graph, ApplicationWindow *app, Mode mode, const QObject *status_target=NULL, const char *status_slot="")
virtual bool | eventFilter (QObject *obj, QEvent *event)
int | findClosestPoint (QwtPlotCurve *c, double x, bool up)
| Searches the index of the closest point to the given x coordinate. More...
bool | keyEventFilter (QKeyEvent *ke)
Mode | mode ()
| Returns the information about the functioning mode of the tool. More...
void | pasteSelection ()
void | removePoint ()
virtual int | rtti () const
QwtPlotCurve * | selectedCurve () const
int | selectedPointIndex ()
void | selectTableRow ()
void | setMode (Mode m)
void | setSelectedCurve (QwtPlotCurve *c)
virtual | ~DataPickerTool ()
Public Member Functions inherited from PlotToolInterface
| PlotToolInterface (Graph *graph, const QObject *status_target=NULL, const char *status_slot="")
virtual | ~PlotToolInterface ()

## Protected Member Functions

virtual void | append (const QPoint &point)
virtual bool | end (bool ok)
virtual void | move (const QPoint &point)
void | moveBy (int dx, int dy)
void | movePoint (const QPoint &cursor)
virtual void | setSelection (QwtPlotCurve *curve, int point_index)

## Protected Attributes

ApplicationWindow * | d_app
Mode | d_mode
MoveMode | d_move_mode
QPoint | d_restricted_move_pos
QwtPlotCurve * | d_selected_curve
int | d_selected_point
QwtPlotMarker | d_selection_marker
Protected Attributes inherited from PlotToolInterface
Graph * | d_graph
const char * | d_status_slot
const QObject * | d_status_target

## Detailed Description

Plot tool for selecting, moving or removing individual points of a curve.

## Member Enumeration Documentation

## Mode

enum DataPickerTool::Mode

Enumerator
Display |
Move |
Remove |
MoveCurve |

## MoveMode

enum DataPickerTool::MoveMode

Enumerator
Free |
Vertical |
Horizontal |

## Constructor & Destructor Documentation

## DataPickerTool()

DataPickerTool::DataPickerTool | ( | Graph * | graph,
|  | ApplicationWindow * | app,
|  | Mode | mode,
|  | const QObject * | status_target = `NULL`,
|  | const char * | status_slot = `""`
| ) |  |

References PlotToolInterface::d_graph, d_mode, d_selected_curve, d_selection_marker, Display, Move, MoveCurve, Remove, and statusText().

## ~DataPickerTool()

DataPickerTool::~DataPickerTool | ( |  | ) |

virtual

References PlotToolInterface::d_graph, and d_selection_marker.

## Member Function Documentation

## append()

void DataPickerTool::append | ( | const QPoint & | point | ) |

protected virtual

References Graph::closestCurve(), PlotToolInterface::d_graph, d_selected_curve, d_selected_point, and setSelection().

Referenced by applicationWindow().

## applicationWindow()

ApplicationWindow* DataPickerTool::applicationWindow | ( |  | ) |

inline

References append(), d_app, end(), move(), moveBy(), movePoint(), pasteSelectionAsLayerText(), selected(), setSelection(), and statusText().

## copySelection()

void DataPickerTool::copySelection | ( |  | ) |

References d_app, d_selected_curve, and d_selected_point.

Referenced by cutSelection(), and selectedPointIndex().

## cutSelection()

void DataPickerTool::cutSelection | ( |  | ) |

References copySelection(), and removePoint().

Referenced by selectedPointIndex().

## end()

bool DataPickerTool::end | ( | bool | ok | ) |

protected virtual

Referenced by applicationWindow().

## eventFilter()

bool DataPickerTool::eventFilter | ( | QObject * | obj,
|  | QEvent * | event
| ) |  |

virtual

References d_mode, d_move_mode, d_selected_curve, d_selected_point, Free, Horizontal, keyEventFilter(), Remove, removePoint(), selected(), and Vertical.

## findClosestPoint()

int DataPickerTool::findClosestPoint | ( | QwtPlotCurve * | c,
|  | double | x,
|  | bool | up
| ) |  |

Searches the index of the closest point to the given x coordinate.

Referenced by setMode().

## keyEventFilter()

bool DataPickerTool::keyEventFilter | ( | QKeyEvent * | ke | ) |

References MdiSubWindow::applicationWindow(), Graph::curve(), Graph::curveCount(), Graph::curveIndex(), PlotToolInterface::d_graph, d_selected_curve, d_selected_point, moveBy(), Graph::multiLayer(), ApplicationWindow::pickPointerCursor(), selected(), Graph::setActiveTool(), and setSelection().

Referenced by eventFilter().

## mode()

Mode DataPickerTool::mode | ( |  | ) |

inline

Returns the information about the functioning mode of the tool.

References d_mode.

## move()

void DataPickerTool::move | ( | const QPoint & | point | ) |

protected virtual

References d_move_mode, d_restricted_move_pos, Free, Horizontal, movePoint(), and Vertical.

Referenced by applicationWindow().

## moveBy()

void DataPickerTool::moveBy | ( | int | dx,
|  | int | dy
| ) |  |

protected

References d_mode, d_selected_curve, d_selected_point, Move, MoveCurve, and movePoint().

Referenced by applicationWindow(), and keyEventFilter().

## movePoint()

void DataPickerTool::movePoint | ( | const QPoint & | cursor | ) |

protected

References Table::colIndex(), Table::columnNumericFormat(), Table::columnType(), d_app, ApplicationWindow::d_decimal_digits, PlotToolInterface::d_graph, d_mode, d_move_mode, d_restricted_move_pos, d_selected_curve, d_selected_point, d_selection_marker, Free, Graph::Function, Horizontal, Table::isReadOnlyColumn(), ApplicationWindow::modifiedProject(), Move, MoveCurve, Table::Numeric, Table::setText(), statusText(), Table::table(), Table::text(), ApplicationWindow::updateCurves(), and Vertical.

Referenced by applicationWindow(), move(), and moveBy().

## pasteSelection()

void DataPickerTool::pasteSelection | ( |  | ) |

References Table::colIndex(), Table::columnNumericFormat(), d_app, ApplicationWindow::d_decimal_digits, PlotToolInterface::d_graph, d_selected_curve, d_selected_point, d_selection_marker, Graph::Function, Table::notifyChanges(), Table::setText(), statusText(), and Table::table().

Referenced by selectedPointIndex().

## pasteSelectionAsLayerText

void DataPickerTool::pasteSelectionAsLayerText | ( |  | ) |

slot

References d_app, PlotToolInterface::d_graph, d_selected_curve, d_selected_point, Graph::newLegend(), FrameWidget::None, FrameWidget::Scales, FrameWidget::setAttachPolicy(), FrameWidget::setFrameStyle(), and FrameWidget::setOriginCoord().

Referenced by applicationWindow().

## removePoint()

void DataPickerTool::removePoint | ( |  | ) |

References Table::clearCell(), Table::colIndex(), Table::columnType(), PlotToolInterface::d_graph, d_selected_curve, d_selected_point, d_selection_marker, Graph::Function, Table::Numeric, and Table::table().

Referenced by cutSelection(), eventFilter(), and selectedPointIndex().

## rtti()

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

inline virtual

Reimplemented from PlotToolInterface.

References PlotToolInterface::Rtti_DataPicker, and selectTableRow().

## selected

void DataPickerTool::selected | ( | QwtPlotCurve * | ,
|  | int |
| ) |  |

signal

Emitted whenever a new data point has been selected.

Referenced by applicationWindow(), eventFilter(), and keyEventFilter().

## selectedCurve()

QwtPlotCurve* DataPickerTool::selectedCurve | ( |  | ) | const

inline

References d_selected_curve.

## selectedPointIndex()

int DataPickerTool::selectedPointIndex | ( |  | ) |

inline

References copySelection(), cutSelection(), d_selected_point, pasteSelection(), and removePoint().

## selectTableRow()

void DataPickerTool::selectTableRow | ( |  | ) |

References Table::colIndex(), d_selected_curve, d_selected_point, Graph::Function, Table::table(), DataCurve::table(), and DataCurve::tableRow().

Referenced by rtti().

## setMode()

void DataPickerTool::setMode | ( | Mode | m | ) |

inline

References d_mode, and findClosestPoint().

Referenced by ApplicationWindow::movePoints().

## setSelectedCurve()

void DataPickerTool::setSelectedCurve | ( | QwtPlotCurve * | c | ) |

inline

References setSelection().

Referenced by BaselineTool::BaselineTool().

## setSelection()

void DataPickerTool::setSelection | ( | QwtPlotCurve * | curve,
|  | int | point_index
| ) |  |

protected virtual

Reimplemented in BaselineTool.

References Table::colIndex(), Table::columnType(), d_app, ApplicationWindow::d_decimal_digits, PlotToolInterface::d_graph, d_restricted_move_pos, d_selected_curve, d_selected_point, d_selection_marker, Graph::Function, Graph::Histogram, Table::Numeric, statusText(), DataCurve::table(), DataCurve::tableRow(), Table::text(), DataCurve::xColumnName(), PlotCurve::xOffset(), DataCurve::xTable(), and PlotCurve::yOffset().

Referenced by append(), applicationWindow(), keyEventFilter(), setSelectedCurve(), and BaselineTool::setSelection().

## statusText

void DataPickerTool::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 applicationWindow(), DataPickerTool(), movePoint(), pasteSelection(), and setSelection().

## Member Data Documentation

## d_app

ApplicationWindow* DataPickerTool::d_app

protected

Referenced by applicationWindow(), copySelection(), movePoint(), pasteSelection(), pasteSelectionAsLayerText(), and setSelection().

## d_mode

Mode DataPickerTool::d_mode

protected

Referenced by DataPickerTool(), eventFilter(), mode(), moveBy(), movePoint(), and setMode().

## d_move_mode

MoveMode DataPickerTool::d_move_mode

protected

Referenced by eventFilter(), move(), and movePoint().

## d_restricted_move_pos

QPoint DataPickerTool::d_restricted_move_pos

protected

Referenced by move(), movePoint(), and setSelection().

## d_selected_curve

QwtPlotCurve* DataPickerTool::d_selected_curve

protected

Referenced by append(), copySelection(), DataPickerTool(), eventFilter(), keyEventFilter(), moveBy(), movePoint(), pasteSelection(), pasteSelectionAsLayerText(), removePoint(), selectedCurve(), selectTableRow(), setSelection(), and BaselineTool::setSelection().

## d_selected_point

int DataPickerTool::d_selected_point

protected

Referenced by append(), copySelection(), eventFilter(), keyEventFilter(), moveBy(), movePoint(), pasteSelection(), pasteSelectionAsLayerText(), removePoint(), selectedPointIndex(), selectTableRow(), and setSelection().

## d_selection_marker

QwtPlotMarker DataPickerTool::d_selection_marker

protected

Referenced by DataPickerTool(), movePoint(), pasteSelection(), removePoint(), setSelection(), and ~DataPickerTool().

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

- qtiplot/src/plot2D/DataPickerTool.h
- qtiplot/src/plot2D/DataPickerTool.cpp