Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_shapeitem.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_plot_shapeitem.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_shapeitem.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 13 13 #include "qwt_global.h" 14 14 #include "qwt_plot_item.h" 15 #include <qpainterpath.h> 15 16 #include <qstring.h> 17 18 class QPainterPath; 19 class QPolygonF; 16 20 17 21 /*! 18 \brief A plot item, which displays any graphical shape, 22 \brief A plot item, which displays any graphical shape, 19 23 that can be defined by a QPainterPath 20 24 21 A QPainterPath is a shape composed from intersecting and uniting 22 regions, rectangles, ellipses or irregular areas defined by lines, and curves. 23 QwtPlotShapeItem displays a shape with a pen and brush. 25 A QPainterPath is a shape composed from intersecting and uniting 26 regions, rectangles, ellipses or irregular areas defined by lines, and curves. 27 QwtPlotShapeItem displays a shape with a pen and brush. 24 28 25 QwtPlotShapeItem offers a couple of optimizations like clipping or weeding. 26 These algorithms need to convert the painter path into polygons that might be 27 less performant for paths built from curves and ellipses. 29 QwtPlotShapeItem offers a couple of optimizations like clipping or weeding. 30 These algorithms need to convert the painter path into polygons that might be 31 less performant for paths built from curves and ellipses. 28 32 29 \sa QwtPlotZone 30 */ 31 class QWT_EXPORT QwtPlotShapeItem: public QwtPlotItem 33 More complex shapes, that can't be expressed by a QPainterPath can be displayed 34 using QwtPlotGraphicItem. 35 36 \sa QwtPlotZone, QwtPlotGraphicItem 37 */ 38 class QWT_EXPORT QwtPlotShapeItem : public QwtPlotItem 32 39 { 33 public: 40 public: 34 41 /*! 35 42 Attributes to modify the drawing algorithm. … … 37 44 38 45 \sa setPaintAttribute(), testPaintAttribute() 39 */ 46 */ 40 47 enum PaintAttribute 41 48 { 42 49 /*! 43 Clip polygons before painting them. In situations, where points 44 are far outside the visible area (f.e when zooming deep) this 45 might be a substantial improvement for the painting performance 50 Clip polygons before painting them. In situations, where points 51 are far outside the visible area (f.e when zooming deep) this 52 might be a substantial improvement for the painting performance 46 53 47 But polygon clipping will convert the painter path into 48 polygons what might introduce a negative impact on the 49 performance of paths composed from curves or ellipses. 54 But polygon clipping will convert the painter path into 55 polygons what might introduce a negative impact on the 56 performance of paths composed from curves or ellipses. 50 57 */ 51 58 ClipPolygons = 0x01, 52 59 }; 53 60 54 //! Paint attributes 55 typedef QFlags<PaintAttribute> PaintAttributes; 61 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute ) 56 62 57 63 //! Mode how to display the item on the legend … … 65 71 }; 66 72 67 explicit QwtPlotShapeItem( const QString &title = QString() );68 explicit QwtPlotShapeItem( const QwtText &title );73 explicit QwtPlotShapeItem( const QString& title = QString() ); 74 explicit QwtPlotShapeItem( const QwtText& title ); 69 75 70 76 virtual ~QwtPlotShapeItem(); … … 76 82 LegendMode legendMode() const; 77 83 78 void setRect( const QRectF & );79 void setPolygon( const QPolygonF & );84 void setRect( const QRectF& ); 85 void setPolygon( const QPolygonF& ); 80 86 81 void setShape( const QPainterPath & );87 void setShape( const QPainterPath& ); 82 88 QPainterPath shape() const; 83 89 84 void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );85 void setPen( const QPen & );90 void setPen( const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine ); 91 void setPen( const QPen& ); 86 92 QPen pen() const; 87 93 88 void setBrush( const QBrush & );94 void setBrush( const QBrush& ); 89 95 QBrush brush() const; 90 96 … … 92 98 double renderTolerance() const; 93 99 94 virtual QRectF boundingRect() const; 100 virtual QRectF boundingRect() const QWT_OVERRIDE; 95 101 96 virtual void draw( QPainter *,97 const QwtScaleMap &xMap, const QwtScaleMap&yMap,98 const QRectF &canvasRect ) const;102 virtual void draw( QPainter*, 103 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 104 const QRectF& canvasRect ) const QWT_OVERRIDE; 99 105 100 virtual QwtGraphic legendIcon( int index, const QSizeF & ) const; 106 virtual QwtGraphic legendIcon( 107 int index, const QSizeF& ) const QWT_OVERRIDE; 101 108 102 virtual int rtti() const; 109 virtual int rtti() const QWT_OVERRIDE; 103 110 104 private: 111 private: 105 112 void init(); 106 113 107 114 class PrivateData; 108 PrivateData *d_data;115 PrivateData* m_data; 109 116 }; 110 117
Note:
See TracChangeset
for help on using the changeset viewer.
