~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.1.2/src/qwt_plot_picker.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2009-04-12 23:25:58 UTC
  • mfrom: (1.1.4 upstream) (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090412232558-3bl06x785yr8xm8u
Tags: 5.1.2-1
* New upstream release.
* Bump compat/debhelper to 7.
* Bump Standards-Version to 3.8.1. No changes needed.
* Invert Maintainers and Uploaders field.
* Fix lintian warnings:
  - dh_clean _k deprecated.
  - missing dependency on libc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
 
2
 * Qwt Widget Library
 
3
 * Copyright (C) 1997   Josef Wilgen
 
4
 * Copyright (C) 2002   Uwe Rathmann
 
5
 * 
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the Qwt License, Version 1.0
 
8
 *****************************************************************************/
 
9
 
 
10
// vim: expandtab
 
11
 
 
12
#ifndef QWT_PLOT_PICKER_H
 
13
#define QWT_PLOT_PICKER_H
 
14
 
 
15
#include "qwt_double_rect.h"
 
16
#include "qwt_plot_canvas.h"
 
17
#include "qwt_picker.h"
 
18
 
 
19
class QwtPlot;
 
20
 
 
21
/*!
 
22
  \brief QwtPlotPicker provides selections on a plot canvas
 
23
 
 
24
  QwtPlotPicker is a QwtPicker tailored for selections on
 
25
  a plot canvas. It is set to a x-Axis and y-Axis and
 
26
  translates all pixel coordinates into this coodinate system.
 
27
*/
 
28
 
 
29
class QWT_EXPORT QwtPlotPicker: public QwtPicker
 
30
{
 
31
    Q_OBJECT
 
32
 
 
33
public:
 
34
    explicit QwtPlotPicker(QwtPlotCanvas *);
 
35
 
 
36
    explicit QwtPlotPicker(int xAxis, int yAxis,
 
37
        QwtPlotCanvas *);
 
38
 
 
39
    explicit QwtPlotPicker(int xAxis, int yAxis, int selectionFlags, 
 
40
        RubberBand rubberBand, DisplayMode trackerMode, 
 
41
        QwtPlotCanvas *);
 
42
 
 
43
    virtual void setAxis(int xAxis, int yAxis);
 
44
 
 
45
    int xAxis() const;
 
46
    int yAxis() const;
 
47
 
 
48
    QwtPlot *plot();
 
49
    const QwtPlot *plot() const;
 
50
    
 
51
    QwtPlotCanvas *canvas();
 
52
    const QwtPlotCanvas *canvas() const;
 
53
 
 
54
signals:
 
55
 
 
56
    /*!
 
57
      A signal emitted in case of selectionFlags() & PointSelection.
 
58
      \param pos Selected point
 
59
    */
 
60
    void selected(const QwtDoublePoint &pos);
 
61
 
 
62
    /*!
 
63
      A signal emitted in case of selectionFlags() & RectSelection.
 
64
      \param rect Selected rectangle
 
65
    */
 
66
    void selected(const QwtDoubleRect &rect);
 
67
 
 
68
    /*!
 
69
      A signal emitting the selected points,
 
70
      at the end of a selection.
 
71
 
 
72
      \param pa Selected points
 
73
    */
 
74
    void selected(const QwtArray<QwtDoublePoint> &pa);
 
75
 
 
76
    /*!
 
77
      A signal emitted when a point has been appended to the selection
 
78
 
 
79
      \param pos Position of the appended point.
 
80
      \sa append(). moved()
 
81
    */
 
82
    void appended(const QwtDoublePoint &pos);
 
83
 
 
84
    /*!
 
85
      A signal emitted whenever the last appended point of the
 
86
      selection has been moved.
 
87
 
 
88
      \param pos Position of the moved last point of the selection.
 
89
      \sa move(), appended() 
 
90
    */
 
91
    void moved(const QwtDoublePoint &pos);
 
92
 
 
93
protected:
 
94
    QwtDoubleRect scaleRect() const;
 
95
 
 
96
    QwtDoubleRect invTransform(const QRect &) const;
 
97
    QRect transform(const QwtDoubleRect &) const;
 
98
 
 
99
    QwtDoublePoint invTransform(const QPoint &) const;
 
100
    QPoint transform(const QwtDoublePoint &) const;
 
101
 
 
102
    virtual QwtText trackerText(const QPoint &) const;
 
103
    virtual QwtText trackerText(const QwtDoublePoint &) const;
 
104
 
 
105
    virtual void move(const QPoint &);
 
106
    virtual void append(const QPoint &);
 
107
    virtual bool end(bool ok = true);
 
108
 
 
109
private:
 
110
    int d_xAxis;
 
111
    int d_yAxis;
 
112
};
 
113
            
 
114
#endif