qwt_polar_marker.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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_MARKER_H
  9. #define QWT_POLAR_MARKER_H
  10. #include "qwt_polar_global.h"
  11. #include "qwt_polar_item.h"
  12. #include <qwt_point_polar.h>
  13. #include <qstring.h>
  14. class QRect;
  15. class QwtText;
  16. class QwtSymbol;
  17. /*!
  18. \brief A class for drawing markers
  19. A marker can be a a symbol, a label or a combination of them, which can
  20. be drawn around a center point inside a bounding rectangle.
  21. The setSymbol() member assigns a symbol to the marker.
  22. The symbol is drawn at the specified point.
  23. With setLabel(), a label can be assigned to the marker.
  24. The setLabelAlignment() member specifies where the label is
  25. drawn. All the Align*-constants in Qt::AlignmentFlags (see Qt documentation)
  26. are valid. The alignment refers to the center point of
  27. the marker, which means, for example, that the label would be painted
  28. left above the center point if the alignment was set to AlignLeft|AlignTop.
  29. */
  30. class QWT_POLAR_EXPORT QwtPolarMarker: public QwtPolarItem
  31. {
  32. public:
  33. explicit QwtPolarMarker();
  34. virtual ~QwtPolarMarker();
  35. virtual int rtti() const;
  36. void setPosition( const QwtPointPolar & );
  37. QwtPointPolar position() const;
  38. void setSymbol( const QwtSymbol *s );
  39. const QwtSymbol *symbol() const;
  40. void setLabel( const QwtText& );
  41. QwtText label() const;
  42. void setLabelAlignment( Qt::Alignment );
  43. Qt::Alignment labelAlignment() const;
  44. virtual void draw( QPainter *painter,
  45. const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap,
  46. const QPointF &pole, double radius,
  47. const QRectF &canvasRect ) const;
  48. virtual QwtInterval boundingInterval( int scaleId ) const;
  49. private:
  50. class PrivateData;
  51. PrivateData *d_data;
  52. };
  53. #endif