Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_item.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_plot_item.h (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_item.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 12 12 13 13 #include "qwt_global.h" 14 #include "qwt_text.h" 15 #include "qwt_legend_data.h" 16 #include "qwt_graphic.h" 17 #include <qrect.h> 18 #include <qlist.h> 14 #include "qwt_axis_id.h" 19 15 #include <qmetatype.h> 20 16 21 class QPainter;22 17 class QwtScaleMap; 23 18 class QwtScaleDiv; 24 19 class QwtPlot; 20 class QwtText; 21 class QwtGraphic; 22 class QwtLegendData; 23 class QRectF; 24 class QPainter; 25 class QString; 26 template< typename T > class QList; 25 27 26 28 /*! 27 \brief Base class for items on the plot canvas 28 29 A plot item is "something", that can be painted on the plot canvas, 30 or only affects the scales of the plot widget. They can be categorized as: 31 32 - Representator\n 29 \brief Base class for items on the plot canvas 30 31 A plot item is "something", that can be painted on the plot canvas, 32 or only affects the scales of the plot widget. They can be categorized as: 33 34 - Representator\n 33 35 A "Representator" is an item that represents some sort of data 34 36 on the plot canvas. The different representator classes are organized … … 42 44 - ... 43 45 44 - Decorators\n 46 - Decorators\n 45 47 A "Decorator" is an item, that displays additional information, that 46 48 is not related to any data: … … 50 52 - ... 51 53 52 Depending on the QwtPlotItem::ItemAttribute flags, an item is included 53 into autoscaling or has an entry on the legend. 54 55 Before misusing the existing item classes it might be better to 56 implement a new type of plot item 57 ( don't implement a watermark as spectrogram ). 58 Deriving a new type of QwtPlotItem primarily means to implement 59 the YourPlotItem::draw() method. 60 61 \sa The cpuplot example shows the implementation of additional plot items. 62 */ 54 Depending on the QwtPlotItem::ItemAttribute flags, an item is included 55 into autoscaling or has an entry on the legend. 56 57 Before misusing the existing item classes it might be better to 58 implement a new type of plot item 59 ( don't implement a watermark as spectrogram ). 60 Deriving a new type of QwtPlotItem primarily means to implement 61 the YourPlotItem::draw() method. 62 63 \sa The cpuplot example shows the implementation of additional plot items. 64 */ 63 65 64 66 class QWT_EXPORT QwtPlotItem 65 67 { 66 public: 68 public: 67 69 /*! 68 70 \brief Runtime type information … … 103 105 Rtti_PlotSpectrogram, 104 106 105 //! For QwtPlotSvgItem 106 Rtti_Plot SVG,107 //! For QwtPlotGraphicItem, QwtPlotSvgItem 108 Rtti_PlotGraphic, 107 109 108 110 //! For QwtPlotTradingCurve … … 123 125 //! For QwtPlotZoneItem 124 126 Rtti_PlotZone, 127 128 //! For QwtPlotVectorField 129 Rtti_PlotVectorField, 125 130 126 131 /*! … … 160 165 }; 161 166 162 //! Plot Item Attributes 163 typedef QFlags<ItemAttribute> ItemAttributes; 167 Q_DECLARE_FLAGS( ItemAttributes, ItemAttribute ) 164 168 165 169 /*! … … 194 198 }; 195 199 196 //! Plot Item Interests 197 typedef QFlags<ItemInterest> ItemInterests; 200 Q_DECLARE_FLAGS( ItemInterests, ItemInterest ) 198 201 199 202 //! Render hints … … 204 207 }; 205 208 206 //! Render hints 207 typedef QFlags<RenderHint> RenderHints; 208 209 explicit QwtPlotItem( const QwtText &title = QwtText() ); 209 Q_DECLARE_FLAGS( RenderHints, RenderHint ) 210 211 explicit QwtPlotItem(); 212 explicit QwtPlotItem( const QString& title ); 213 explicit QwtPlotItem( const QwtText& title ); 214 210 215 virtual ~QwtPlotItem(); 211 216 212 void attach( QwtPlot *plot );217 void attach( QwtPlot* plot ); 213 218 void detach(); 214 219 215 QwtPlot *plot() const;216 217 void setTitle( const QString &title );218 void setTitle( const QwtText &title );219 const QwtText &title() const;220 QwtPlot* plot() const; 221 222 void setTitle( const QString& title ); 223 void setTitle( const QwtText& title ); 224 const QwtText& title() const; 220 225 221 226 virtual int rtti() const; … … 233 238 uint renderThreadCount() const; 234 239 235 void setLegendIconSize( const QSize & );240 void setLegendIconSize( const QSize& ); 236 241 QSize legendIconSize() const; 237 242 … … 244 249 bool isVisible () const; 245 250 246 void setAxes( intxAxis,intyAxis );247 248 void setXAxis( int axis);249 intxAxis() const;250 251 void setYAxis( int axis);252 intyAxis() const;251 void setAxes( QwtAxisId xAxis, QwtAxisId yAxis ); 252 253 void setXAxis( QwtAxisId ); 254 QwtAxisId xAxis() const; 255 256 void setYAxis( QwtAxisId ); 257 QwtAxisId yAxis() const; 253 258 254 259 virtual void itemChanged(); … … 256 261 257 262 /*! 258 \brief Draw the item 259 260 \param painter Painter 261 \param xMap Maps x-values into pixel coordinates. 262 \param yMap Maps y-values into pixel coordinates. 263 \param canvasRect Contents rect of the canvas in painter coordinates 264 */ 265 virtual void draw( QPainter *painter,266 const QwtScaleMap &xMap, const QwtScaleMap&yMap,267 const QRectF &canvasRect ) const = 0;263 \brief Draw the item 264 265 \param painter Painter 266 \param xMap Maps x-values into pixel coordinates. 267 \param yMap Maps y-values into pixel coordinates. 268 \param canvasRect Contents rect of the canvas in painter coordinates 269 */ 270 virtual void draw( QPainter* painter, 271 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 272 const QRectF& canvasRect ) const = 0; 268 273 269 274 virtual QRectF boundingRect() const; 270 275 271 276 virtual void getCanvasMarginHint( 272 const QwtScaleMap &xMap, const QwtScaleMap&yMap,273 const QRectF &canvasRect,274 double &left, double&top, double&right, double&bottom) const;277 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 278 const QRectF& canvasRect, 279 double& left, double& top, double& right, double& bottom) const; 275 280 276 281 virtual void updateScaleDiv( 277 282 const QwtScaleDiv&, const QwtScaleDiv& ); 278 283 279 virtual void updateLegend( const QwtPlotItem *, 280 const QList<QwtLegendData> & ); 281 282 QRectF scaleRect( const QwtScaleMap &, const QwtScaleMap & ) const; 283 QRectF paintRect( const QwtScaleMap &, const QwtScaleMap & ) const; 284 285 virtual QList<QwtLegendData> legendData() const; 286 287 virtual QwtGraphic legendIcon( int index, const QSizeF & ) const; 288 289 protected: 290 QwtGraphic defaultIcon( const QBrush &, const QSizeF & ) const; 291 292 private: 293 // Disabled copy constructor and operator= 294 QwtPlotItem( const QwtPlotItem & ); 295 QwtPlotItem &operator=( const QwtPlotItem & ); 284 virtual void updateLegend( const QwtPlotItem*, 285 const QList< QwtLegendData >& ); 286 287 QRectF scaleRect( const QwtScaleMap&, const QwtScaleMap& ) const; 288 QRectF paintRect( const QwtScaleMap&, const QwtScaleMap& ) const; 289 290 virtual QList< QwtLegendData > legendData() const; 291 292 virtual QwtGraphic legendIcon( int index, const QSizeF& ) const; 293 294 protected: 295 QwtGraphic defaultIcon( const QBrush&, const QSizeF& ) const; 296 297 private: 298 Q_DISABLE_COPY(QwtPlotItem) 296 299 297 300 class PrivateData; 298 PrivateData *d_data;301 PrivateData* m_data; 299 302 }; 300 303 … … 303 306 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::RenderHints ) 304 307 305 Q_DECLARE_METATYPE( QwtPlotItem * )308 Q_DECLARE_METATYPE( QwtPlotItem* ) 306 309 307 310 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
