qwt_plot_seriesitem.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #ifndef QWT_PLOT_SERIES_ITEM_H
  10. #define QWT_PLOT_SERIES_ITEM_H
  11. #include "qwt_global.h"
  12. #include "qwt_plot_item.h"
  13. #include "qwt_scale_div.h"
  14. #include "qwt_series_data.h"
  15. #include "qwt_series_store.h"
  16. /*!
  17. \brief Base class for plot items representing a series of samples
  18. */
  19. class QWT_EXPORT QwtPlotSeriesItem: public QwtPlotItem,
  20. public virtual QwtAbstractSeriesStore
  21. {
  22. public:
  23. explicit QwtPlotSeriesItem( const QString &title = QString() );
  24. explicit QwtPlotSeriesItem( const QwtText &title );
  25. virtual ~QwtPlotSeriesItem();
  26. void setOrientation( Qt::Orientation );
  27. Qt::Orientation orientation() const;
  28. virtual void draw( QPainter *,
  29. const QwtScaleMap &xMap, const QwtScaleMap &yMap,
  30. const QRectF & ) const;
  31. /*!
  32. Draw a subset of the samples
  33. \param painter Painter
  34. \param xMap Maps x-values into pixel coordinates.
  35. \param yMap Maps y-values into pixel coordinates.
  36. \param canvasRect Contents rectangle of the canvas
  37. \param from Index of the first point to be painted
  38. \param to Index of the last point to be painted. If to < 0 the
  39. curve will be painted to its last point.
  40. */
  41. virtual void drawSeries( QPainter *painter,
  42. const QwtScaleMap &xMap, const QwtScaleMap &yMap,
  43. const QRectF &canvasRect, int from, int to ) const = 0;
  44. virtual QRectF boundingRect() const;
  45. virtual void updateScaleDiv(
  46. const QwtScaleDiv &, const QwtScaleDiv & );
  47. protected:
  48. virtual void dataChanged();
  49. private:
  50. class PrivateData;
  51. PrivateData *d_data;
  52. };
  53. #endif