#include <DataPickerTool.h>
Public Types | |
enum | Mode { Display, Move, Remove } |
enum | MoveMode { Free, Vertical, Horizontal } |
Signals | |
void | selected (QwtPlotCurve *, int) |
Emitted whenever a new data point has been selected. | |
void | statusText (const QString &) |
Public Member Functions | |
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. | |
bool | keyEventFilter (QKeyEvent *ke) |
void | pasteSelection () |
void | removePoint () |
virtual int | rtti () const |
QwtPlotCurve * | selectedCurve () const |
void | selectTableRow () |
virtual | ~DataPickerTool () |
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) |
void | setSelection (QwtPlotCurve *curve, int point_index) |
Private 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 |
enum DataPickerTool::Mode |
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, Remove, statusText(), and vizor_xpm.
DataPickerTool::~DataPickerTool | ( | ) | [virtual] |
References PlotToolInterface::d_graph, and d_selection_marker.
void DataPickerTool::append | ( | const QPoint & | point | ) | [protected, virtual] |
References Graph::closestCurve(), PlotToolInterface::d_graph, d_selected_curve, d_selected_point, and setSelection().
void DataPickerTool::copySelection | ( | ) |
References d_app, d_selected_curve, d_selected_point, and ApplicationWindow::locale().
Referenced by cutSelection().
void DataPickerTool::cutSelection | ( | ) |
References copySelection(), and removePoint().
bool DataPickerTool::end | ( | bool | ok | ) | [protected, virtual] |
References d_mode, d_selected_curve, and Move.
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.
int DataPickerTool::findClosestPoint | ( | QwtPlotCurve * | c, | |
double | x, | |||
bool | up | |||
) |
bool DataPickerTool::keyEventFilter | ( | QKeyEvent * | ke | ) |
References Graph::curve(), Graph::curveCount(), Graph::curveIndex(), PlotToolInterface::d_graph, d_mode, d_selected_curve, d_selected_point, findClosestPoint(), Move, moveBy(), selected(), and setSelection().
Referenced by eventFilter().
void DataPickerTool::move | ( | const QPoint & | point | ) | [protected, virtual] |
References d_mode, d_move_mode, d_restricted_move_pos, Free, Horizontal, Move, movePoint(), and Vertical.
void DataPickerTool::moveBy | ( | int | dx, | |
int | dy | |||
) | [protected] |
void DataPickerTool::movePoint | ( | const QPoint & | cursor | ) | [protected] |
References Table::colIndex(), Table::columnType(), d_app, ApplicationWindow::d_decimal_digits, PlotToolInterface::d_graph, d_move_mode, d_restricted_move_pos, d_selected_curve, d_selected_point, d_selection_marker, Free, Graph::Function, Horizontal, Table::isReadOnlyColumn(), ApplicationWindow::locale(), ApplicationWindow::modifiedProject(), Table::Numeric, Table::setText(), statusText(), ApplicationWindow::updateCurves(), and Vertical.
void DataPickerTool::pasteSelection | ( | ) |
void DataPickerTool::removePoint | ( | ) |
References Table::clearCell(), Table::colIndex(), Table::columnType(), PlotToolInterface::d_graph, d_selected_curve, d_selected_point, d_selection_marker, Graph::Function, and Table::Numeric.
Referenced by cutSelection(), and eventFilter().
virtual int DataPickerTool::rtti | ( | ) | const [inline, virtual] |
void DataPickerTool::selected | ( | QwtPlotCurve * | , | |
int | ||||
) | [signal] |
Emitted whenever a new data point has been selected.
Referenced by eventFilter(), and keyEventFilter().
QwtPlotCurve* DataPickerTool::selectedCurve | ( | ) | const [inline] |
References d_selected_curve.
void DataPickerTool::selectTableRow | ( | ) |
References d_selected_curve, d_selected_point, Graph::Function, and Table::goToRow().
void DataPickerTool::setSelection | ( | QwtPlotCurve * | curve, | |
int | point_index | |||
) | [protected] |
References Table::colIndex(), d_app, ApplicationWindow::d_decimal_digits, PlotToolInterface::d_graph, d_restricted_move_pos, d_selected_curve, d_selected_point, d_selection_marker, Graph::Function, ApplicationWindow::locale(), statusText(), and Table::text().
Referenced by append(), and keyEventFilter().
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 DataPickerTool(), movePoint(), pasteSelection(), and setSelection().
ApplicationWindow* DataPickerTool::d_app [private] |
Referenced by copySelection(), movePoint(), pasteSelection(), and setSelection().
Mode DataPickerTool::d_mode [private] |
Referenced by DataPickerTool(), end(), eventFilter(), keyEventFilter(), and move().
MoveMode DataPickerTool::d_move_mode [private] |
Referenced by eventFilter(), move(), and movePoint().
QPoint DataPickerTool::d_restricted_move_pos [private] |
Referenced by move(), movePoint(), and setSelection().
QwtPlotCurve* DataPickerTool::d_selected_curve [private] |
Referenced by append(), copySelection(), DataPickerTool(), end(), eventFilter(), keyEventFilter(), moveBy(), movePoint(), pasteSelection(), removePoint(), selectedCurve(), selectTableRow(), and setSelection().
int DataPickerTool::d_selected_point [private] |
Referenced by append(), copySelection(), eventFilter(), keyEventFilter(), moveBy(), movePoint(), pasteSelection(), removePoint(), selectTableRow(), and setSelection().
QwtPlotMarker DataPickerTool::d_selection_marker [private] |
Referenced by DataPickerTool(), movePoint(), pasteSelection(), removePoint(), setSelection(), and ~DataPickerTool().