qwt_polar_renderer.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_RENDERER_H
  9. #define QWT_POLAR_RENDERER_H 1
  10. #include "qwt_polar_global.h"
  11. #include <qobject.h>
  12. #include <qsize.h>
  13. class QwtPolarPlot;
  14. class QRectF;
  15. class QPainter;
  16. class QPrinter;
  17. class QPaintDevice;
  18. #ifndef QWT_NO_POLAR_SVG
  19. #ifdef QT_SVG_LIB
  20. class QSvgGenerator;
  21. #endif
  22. #endif
  23. /*!
  24. \brief Renderer for exporting a polar plot to a document, a printer
  25. or anything else, that is supported by QPainter/QPaintDevice
  26. */
  27. class QWT_POLAR_EXPORT QwtPolarRenderer: public QObject
  28. {
  29. Q_OBJECT
  30. public:
  31. explicit QwtPolarRenderer( QObject *parent = NULL );
  32. virtual ~QwtPolarRenderer();
  33. void renderDocument( QwtPolarPlot *, const QString &format,
  34. const QSizeF &sizeMM, int resolution = 85 );
  35. void renderDocument( QwtPolarPlot *,
  36. const QString &title, const QString &format,
  37. const QSizeF &sizeMM, int resolution = 85 );
  38. #ifndef QWT_NO_POLAR_SVG
  39. #ifdef QT_SVG_LIB
  40. #if QT_VERSION >= 0x040500
  41. void renderTo( QwtPolarPlot *, QSvgGenerator & ) const;
  42. #endif
  43. #endif
  44. #endif
  45. void renderTo( QwtPolarPlot *, QPrinter & ) const;
  46. void renderTo( QwtPolarPlot *, QPaintDevice & ) const;
  47. virtual void render( QwtPolarPlot *,
  48. QPainter *, const QRectF &rect ) const;
  49. bool exportTo( QwtPolarPlot *, const QString &documentName,
  50. const QSizeF &sizeMM = QSizeF( 200, 200 ), int resolution = 85 );
  51. virtual void renderTitle( QPainter *, const QRectF & ) const;
  52. virtual void renderLegend(
  53. const QwtPolarPlot *, QPainter *, const QRectF & ) const;
  54. private:
  55. class PrivateData;
  56. PrivateData *d_data;
  57. };
  58. #endif