Qwt User's Guide svn
qwt_plot_picker.h
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #ifndef QWT_PLOT_PICKER_H
00011 #define QWT_PLOT_PICKER_H
00012 
00013 #include "qwt_global.h"
00014 #include "qwt_plot_canvas.h"
00015 #include "qwt_picker.h"
00016 #include <qvector.h>
00017 
00018 class QwtPlot;
00019 
00028 class QWT_EXPORT QwtPlotPicker: public QwtPicker
00029 {
00030     Q_OBJECT
00031 
00032 public:
00033     explicit QwtPlotPicker( QwtPlotCanvas * );
00034     virtual ~QwtPlotPicker();
00035 
00036     explicit QwtPlotPicker( int xAxis, int yAxis, QwtPlotCanvas * );
00037 
00038     explicit QwtPlotPicker( int xAxis, int yAxis,
00039         RubberBand rubberBand, DisplayMode trackerMode,
00040         QwtPlotCanvas * );
00041 
00042     virtual void setAxis( int xAxis, int yAxis );
00043 
00044     int xAxis() const;
00045     int yAxis() const;
00046 
00047     QwtPlot *plot();
00048     const QwtPlot *plot() const;
00049 
00050     QwtPlotCanvas *canvas();
00051     const QwtPlotCanvas *canvas() const;
00052 
00053 Q_SIGNALS:
00054 
00059     void selected( const QPointF &pos );
00060 
00065     void selected( const QRectF &rect );
00066 
00073     void selected( const QVector<QPointF> &pa );
00074 
00081     void appended( const QPointF &pos );
00082 
00090     void moved( const QPointF &pos );
00091 
00092 protected:
00093     QRectF scaleRect() const;
00094 
00095     QRectF invTransform( const QRect & ) const;
00096     QRect transform( const QRectF & ) const;
00097 
00098     QPointF invTransform( const QPoint & ) const;
00099     QPoint transform( const QPointF & ) const;
00100 
00101     virtual QwtText trackerText( const QPoint & ) const;
00102     virtual QwtText trackerTextF( const QPointF & ) const;
00103 
00104     virtual void move( const QPoint & );
00105     virtual void append( const QPoint & );
00106     virtual bool end( bool ok = true );
00107 
00108 private:
00109     int d_xAxis;
00110     int d_yAxis;
00111 };
00112 
00113 #endif
qmi style