Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_graphic.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_graphic.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_graphic.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_null_paintdevice.h" 15 15 16 #include <qmetatype.h> 16 #include <qimage.h>17 #include <qpixmap.h>18 17 19 18 class QwtPainterCommand; 19 class QPixmap; 20 class QImage; 20 21 21 22 /*! … … 72 73 \sa QwtPainterCommand 73 74 */ 74 class QWT_EXPORT QwtGraphic: public QwtNullPaintDevice 75 class QWT_EXPORT QwtGraphic : public QwtNullPaintDevice 75 76 { 76 public: 77 public: 77 78 /*! 78 79 Hint how to render a graphic … … 96 97 }; 97 98 99 Q_DECLARE_FLAGS( RenderHints, RenderHint ) 100 98 101 /*! 99 \brief Render hints 100 101 The default setting is to disable all hints 102 Indicator if the graphic contains a specific type of painter command 103 \sa CommandTypes, commandTypes(); 102 104 */ 103 typedef QFlags<RenderHint> RenderHints; 105 enum CommandType 106 { 107 //! The graphic contains scalable vector data 108 VectorData = 1 << 0, 109 110 //! The graphic contains raster data ( QPixmap or QImage ) 111 RasterData = 1 << 1, 112 113 //! The graphic contains transformations beyond simple translations 114 Transformation = 1 << 2 115 }; 116 117 Q_DECLARE_FLAGS( CommandTypes, CommandType ) 104 118 105 119 QwtGraphic(); 106 QwtGraphic( const QwtGraphic & );120 QwtGraphic( const QwtGraphic& ); 107 121 108 122 virtual ~QwtGraphic(); 109 123 110 QwtGraphic& operator=( const QwtGraphic & );124 QwtGraphic& operator=( const QwtGraphic& ); 111 125 112 126 void reset(); … … 115 129 bool isEmpty() const; 116 130 117 void render( QPainter * ) const; 118 119 void render( QPainter *, const QSizeF &, 120 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 121 122 void render( QPainter *, const QRectF &, 123 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 124 125 void render( QPainter *, const QPointF &, 131 CommandTypes commandTypes() const; 132 133 void render( QPainter* ) const; 134 135 void render( QPainter*, const QSizeF&, 136 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 137 138 void render( QPainter*, const QPointF&, 126 139 Qt::Alignment = Qt::AlignTop | Qt::AlignLeft ) const; 127 140 128 QPixmap toPixmap() const; 129 QPixmap toPixmap( const QSize &, 130 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 131 132 QImage toImage() const; 133 QImage toImage( const QSize &, 134 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 135 136 QRectF scaledBoundingRect( double sx, double sy ) const; 141 void render( QPainter*, const QRectF&, 142 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 143 144 QPixmap toPixmap( qreal devicePixelRatio = 0.0 ) const; 145 146 QPixmap toPixmap( const QSize&, 147 Qt::AspectRatioMode = Qt::IgnoreAspectRatio, 148 qreal devicePixelRatio = 0.0 ) const; 149 150 QImage toImage( qreal devicePixelRatio = 0.0 ) const; 151 152 QImage toImage( const QSize&, 153 Qt::AspectRatioMode = Qt::IgnoreAspectRatio, 154 qreal devicePixelRatio = 0.0 ) const; 155 156 QRectF scaledBoundingRect( qreal sx, qreal sy ) const; 137 157 138 158 QRectF boundingRect() const; 139 159 QRectF controlPointRect() const; 140 160 141 const QVector< QwtPainterCommand > &commands() const;142 void setCommands( QVector< QwtPainterCommand > & );143 144 void setDefaultSize( const QSizeF & );161 const QVector< QwtPainterCommand >& commands() const; 162 void setCommands( const QVector< QwtPainterCommand >& ); 163 164 void setDefaultSize( const QSizeF& ); 145 165 QSizeF defaultSize() const; 166 167 qreal heightForWidth( qreal width ) const; 168 qreal widthForHeight( qreal height ) const; 146 169 147 170 void setRenderHint( RenderHint, bool on = true ); 148 171 bool testRenderHint( RenderHint ) const; 149 172 150 protected: 151 virtual QSize sizeMetrics() const; 152 153 virtual void drawPath( const QPainterPath & ); 154 155 virtual void drawPixmap( const QRectF &, 156 const QPixmap &, const QRectF & ); 157 158 virtual void drawImage( const QRectF &, 159 const QImage &, const QRectF &, Qt::ImageConversionFlags ); 160 161 virtual void updateState( const QPaintEngineState &state ); 162 163 private: 164 void updateBoundingRect( const QRectF & ); 165 void updateControlPointRect( const QRectF & ); 173 RenderHints renderHints() const; 174 175 protected: 176 virtual QSize sizeMetrics() const QWT_OVERRIDE; 177 178 virtual void drawPath( const QPainterPath& ) QWT_OVERRIDE; 179 180 virtual void drawPixmap( const QRectF&, 181 const QPixmap&, const QRectF& ) QWT_OVERRIDE; 182 183 virtual void drawImage( const QRectF&, const QImage&, 184 const QRectF&, Qt::ImageConversionFlags ) QWT_OVERRIDE; 185 186 virtual void updateState( const QPaintEngineState& ) QWT_OVERRIDE; 187 188 private: 189 void renderGraphic( QPainter*, QTransform* ) const; 190 191 void updateBoundingRect( const QRectF& ); 192 void updateControlPointRect( const QRectF& ); 166 193 167 194 class PathInfo; 168 195 169 196 class PrivateData; 170 PrivateData *d_data;197 PrivateData* m_data; 171 198 }; 172 199 173 200 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtGraphic::RenderHints ) 201 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtGraphic::CommandTypes ) 174 202 Q_DECLARE_METATYPE( QwtGraphic ) 175 203
Note:
See TracChangeset
for help on using the changeset viewer.
