CanvasPicker.h
Go to the documentation of this file.
/***************************************************************************
File : CanvasPicker.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2006 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Canvas picker
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#include <QObject>
#include <QPoint>
#include <QMouseEvent>
class Graph;
class ArrowMarker;
class CanvasPicker: public QObject
{
Q_OBJECT
public:
CanvasPicker(Graph *plot);
virtual bool eventFilter(QObject *, QEvent *);
void selectPoints(int n);
void selectPeak(const QPoint& p);
void disableEditing();
private:
void drawLineMarker(const QPoint&, bool endArrow);
bool selectMarker(const QMouseEvent *e);
Graph *plot(){return (Graph *)parent();};
QPoint startLinePoint, endLinePoint;
signals:
void showPlotDialog(int);
void viewLineDialog();
void showMarkerPopupMenu();
void modified();
private:
bool pointSelected;
ArrowMarker *d_editing_marker;
};
CanvasPicker::d_editing_marker
ArrowMarker * d_editing_marker
The marker that is currently being edited, or NULL. Editing does explicitly not inlude moving and res...
Definition: CanvasPicker.h:84
CanvasPicker::disableEditing
void disableEditing()
Disable editing of d_editing_marker on a TAB-key event.
Definition: CanvasPicker.cpp:219
CanvasPicker::endLinePoint
QPoint endLinePoint
Definition: CanvasPicker.h:66
Graph
A 2D-plotting widget.
Definition: Graph.h:123
CanvasPicker::selectPeak
void selectPeak(const QPoint &p)
CanvasPicker::showMarkerPopupMenu
void showMarkerPopupMenu()
CanvasPicker
Handles parts of the user interaction for a Plot by registering itself as an event filter for its Qwt...
Definition: CanvasPicker.h:40
ArrowMarker
Draws lines and arrows on a QwtPlot.
Definition: ArrowMarker.h:43
CanvasPicker::modified
void modified()
CanvasPicker::plot
Graph * plot()
Return my parent as a Graph.
Definition: CanvasPicker.h:66
CanvasPicker::CanvasPicker
CanvasPicker(Graph *plot)
Definition: CanvasPicker.cpp:41
CanvasPicker::selectPoints
void selectPoints(int n)
CanvasPicker::selectMarker
bool selectMarker(const QMouseEvent *e)
Selects and highlights the marker at the given position.
Definition: CanvasPicker.cpp:251
CanvasPicker::drawLineMarker
void drawLineMarker(const QPoint &, bool endArrow)
Definition: CanvasPicker.cpp:227
CanvasPicker::viewLineDialog
void viewLineDialog()
CanvasPicker::startLinePoint
QPoint startLinePoint
Definition: CanvasPicker.h:66
CanvasPicker::eventFilter
virtual bool eventFilter(QObject *, QEvent *)
Definition: CanvasPicker.cpp:51
CanvasPicker::showPlotDialog
void showPlotDialog(int)
CanvasPicker::pointSelected
bool pointSelected
Definition: CanvasPicker.h:77