qwt_polar_picker.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
  2. * QwtPolar Widget Library
  3. * Copyright (C) 2008 Uwe Rathmann
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the Qwt License, Version 1.0
  7. *****************************************************************************/
  8. #ifndef QWT_POLAR_PICKER_H
  9. #define QWT_POLAR_PICKER_H
  10. #include "qwt_polar_global.h"
  11. #include "qwt_picker.h"
  12. #include <qvector.h>
  13. #include <qpainterpath.h>
  14. class QwtPolarPlot;
  15. class QwtPolarCanvas;
  16. class QwtPointPolar;
  17. /*!
  18. \brief QwtPolarPicker provides selections on a plot canvas
  19. QwtPolarPicker is a QwtPicker tailored for selections on
  20. a polar plot canvas.
  21. */
  22. class QWT_POLAR_EXPORT QwtPolarPicker: public QwtPicker
  23. {
  24. Q_OBJECT
  25. public:
  26. explicit QwtPolarPicker( QwtPolarCanvas * );
  27. virtual ~QwtPolarPicker();
  28. explicit QwtPolarPicker(
  29. RubberBand rubberBand, DisplayMode trackerMode,
  30. QwtPolarCanvas * );
  31. QwtPolarPlot *plot();
  32. const QwtPolarPlot *plot() const;
  33. QwtPolarCanvas *canvas();
  34. const QwtPolarCanvas *canvas() const;
  35. virtual QRect pickRect() const;
  36. Q_SIGNALS:
  37. /*!
  38. A signal emitted in case of selectionFlags() & PointSelection.
  39. \param pos Selected point
  40. */
  41. void selected( const QwtPointPolar &pos );
  42. /*!
  43. A signal emitting the selected points,
  44. at the end of a selection.
  45. \param points Selected points
  46. */
  47. void selected( const QVector<QwtPointPolar> &points );
  48. /*!
  49. A signal emitted when a point has been appended to the selection
  50. \param pos Position of the appended point.
  51. \sa append(). moved()
  52. */
  53. void appended( const QwtPointPolar &pos );
  54. /*!
  55. A signal emitted whenever the last appended point of the
  56. selection has been moved.
  57. \param pos Position of the moved last point of the selection.
  58. \sa move(), appended()
  59. */
  60. void moved( const QwtPointPolar &pos );
  61. protected:
  62. QwtPointPolar invTransform( const QPoint & ) const;
  63. virtual QwtText trackerText( const QPoint & ) const;
  64. virtual QwtText trackerTextPolar( const QwtPointPolar & ) const;
  65. virtual void move( const QPoint & );
  66. virtual void append( const QPoint & );
  67. virtual bool end( bool ok = true );
  68. private:
  69. virtual QPainterPath pickArea() const;
  70. class PrivateData;
  71. PrivateData *d_data;
  72. };
  73. #endif