Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_raster_data.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_raster_data.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_raster_data.h
r8127 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 9 9 10 10 #ifndef QWT_RASTER_DATA_H 11 #define QWT_RASTER_DATA_H 111 #define QWT_RASTER_DATA_H 12 12 13 13 #include "qwt_global.h" 14 #include "qwt_interval.h" 15 #include <qmap.h> 16 #include <qlist.h> 17 #include <qpolygon.h> 14 #include <qnamespace.h> 18 15 19 class QwtScaleMap; 16 class QwtInterval; 17 class QPolygonF; 18 class QRectF; 19 class QSize; 20 template< typename T > class QList; 21 template< class Key, class T > class QMap; 20 22 21 23 /*! 22 \brief QwtRasterData defines an interface to any type of raster data. 24 \brief QwtRasterData defines an interface to any type of raster data. 23 25 24 QwtRasterData is an abstract interface, that is used by 25 QwtPlotRasterItem to find the values at the pixels of its raster. 26 QwtRasterData is an abstract interface, that is used by 27 QwtPlotRasterItem to find the values at the pixels of its raster. 26 28 27 Often a raster item is used to display values from a matrix. Then the 28 derived raster data class needs to implement some sort of resampling, 29 that maps the raster of the matrix into the requested raster of 30 the raster item ( depending on resolution and scales of the canvas ). 31 */ 29 Gaps inside the bounding rectangle of the data can be indicated by NaN 30 values ( when WithoutGaps is disabled ). 31 32 Often a raster item is used to display values from a matrix. Then the 33 derived raster data class needs to implement some sort of resampling, 34 that maps the raster of the matrix into the requested raster of 35 the raster item ( depending on resolution and scales of the canvas ). 36 37 QwtMatrixRasterData implements raster data, that returns values from 38 a given 2D matrix. 39 40 \sa QwtMatrixRasterData 41 */ 32 42 class QWT_EXPORT QwtRasterData 33 43 { 34 public: 44 public: 35 45 //! Contour lines 36 typedef QMap<double, QPolygonF> ContourLines; 46 typedef QMap< double, QPolygonF > ContourLines; 47 48 /*! 49 \brief Raster data attributes 50 51 Additional information that is used to improve processing 52 of the data. 53 */ 54 enum Attribute 55 { 56 /*! 57 The bounding rectangle of the data is spanned by 58 the interval(Qt::XAxis) and interval(Qt::YAxis). 59 60 WithoutGaps indicates, that the data has no gaps 61 ( unknown values ) in this area and the result of 62 value() does not need to be checked for NaN values. 63 64 Enabling this flag will have an positive effect on 65 the performance of rendering a QwtPlotSpectrogram. 66 67 The default setting is false. 68 69 \note NaN values indicate an undefined value 70 */ 71 WithoutGaps = 0x01 72 }; 73 74 Q_DECLARE_FLAGS( Attributes, Attribute ) 37 75 38 76 //! Flags to modify the contour algorithm … … 46 84 }; 47 85 48 //! Flags to modify the contour algorithm 49 typedef QFlags<ConrecFlag> ConrecFlags; 86 Q_DECLARE_FLAGS( ConrecFlags, ConrecFlag ) 50 87 51 88 QwtRasterData(); 52 89 virtual ~QwtRasterData(); 53 90 54 v irtual void setInterval( Qt::Axis, const QwtInterval &);55 const QwtInterval &interval(Qt::Axis) const;91 void setAttribute( Attribute, bool on = true ); 92 bool testAttribute( Attribute ) const; 56 93 57 virtual QRectF pixelHint( const QRectF & ) const; 94 /*! 95 \return Bounding interval for an axis 96 \sa setInterval 97 */ 98 virtual QwtInterval interval( Qt::Axis ) const = 0; 58 99 59 virtual void initRaster( const QRectF &, const QSize& raster ); 100 virtual QRectF pixelHint( const QRectF& ) const; 101 102 virtual void initRaster( const QRectF&, const QSize& raster ); 60 103 virtual void discardRaster(); 61 104 … … 64 107 \param x X value in plot coordinates 65 108 \param y Y value in plot coordinates 66 */ 109 */ 67 110 virtual double value( double x, double y ) const = 0; 68 111 69 virtual ContourLines contourLines( const QRectF &rect,70 const QSize &raster, const QList<double> &levels,112 virtual ContourLines contourLines( const QRectF& rect, 113 const QSize& raster, const QList< double >& levels, 71 114 ConrecFlags ) const; 72 115 … … 74 117 class ContourPlane; 75 118 76 private: 77 // Disabled copy constructor and operator= 78 QwtRasterData( const QwtRasterData & ); 79 QwtRasterData &operator=( const QwtRasterData & ); 119 private: 120 Q_DISABLE_COPY(QwtRasterData) 80 121 81 QwtInterval d_intervals[3]; 122 class PrivateData; 123 PrivateData* m_data; 82 124 }; 83 125 84 /*!85 \return Bounding interval for a axis86 \sa setInterval87 */88 inline const QwtInterval &QwtRasterData::interval( Qt::Axis axis) const89 {90 return d_intervals[axis];91 }92 93 126 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtRasterData::ConrecFlags ) 127 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtRasterData::Attributes ) 94 128 95 129 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
