Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_symbol.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_symbol.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_symbol.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 14 15 #include <qpolygon.h> 16 #include <qpen.h> 17 #include <qbrush.h> 15 18 16 19 class QPainter; 17 class QRect;18 20 class QSize; 19 21 class QBrush; … … 21 23 class QColor; 22 24 class QPointF; 23 class QPolygonF;24 25 class QPainterPath; 25 26 class QPixmap; … … 30 31 class QWT_EXPORT QwtSymbol 31 32 { 32 public: 33 public: 33 34 /*! 34 Symbol Style 35 \sa setStyle(), style() 35 Symbol Style 36 \sa setStyle(), style() 36 37 */ 37 38 enum Style … … 86 87 87 88 /*! 88 The symbol is represented by a painter path, where the 89 origin ( 0, 0 ) of the path coordinate system is mapped to 90 the position of the symbol. 91 92 \sa setPath(), path() 89 The symbol is represented by a painter path, where the 90 origin ( 0, 0 ) of the path coordinate system is mapped to 91 the position of the symbol. 92 93 \sa setPath(), path() 93 94 */ 94 95 Path, 95 96 96 97 /*! 97 The symbol is represented by a pixmap. The pixmap is centered 98 or aligned to its pin point. 99 100 \sa setPinPoint() 98 The symbol is represented by a pixmap. The pixmap is centered 99 or aligned to its pin point. 100 101 \sa setPinPoint() 101 102 */ 102 103 Pixmap, 103 104 104 105 /*! 105 The symbol is represented by a graphic. The graphic is centered 106 or aligned to its pin point. 107 108 \sa setPinPoint() 106 The symbol is represented by a graphic. The graphic is centered 107 or aligned to its pin point. 108 109 \sa setPinPoint() 109 110 */ 110 111 Graphic, 111 112 112 113 /*! 113 The symbol is represented by a SVG graphic. The graphic is centered 114 or aligned to its pin point. 115 116 \sa setPinPoint() 114 The symbol is represented by a SVG graphic. The graphic is centered 115 or aligned to its pin point. 116 117 \sa setPinPoint() 117 118 */ 118 119 SvgDocument, 119 120 120 121 /*! 121 Styles >= QwtSymbol::UserSymbol are reserved for derived 122 classes of QwtSymbol that overload drawSymbols() with 123 additional application specific symbol types. 122 Styles >= QwtSymbol::UserSymbol are reserved for derived 123 classes of QwtSymbol that overload drawSymbols() with 124 additional application specific symbol types. 124 125 */ 125 126 UserStyle = 1000 … … 127 128 128 129 /*! 129 Depending on the render engine and the complexity of the 130 symbol shape it might be faster to render the symbol 131 to a pixmap and to paint this pixmap. 132 133 F.e. the raster paint engine is a pure software renderer 134 where in cache mode a draw operation usually ends in 135 raster operation with the the backing store, that are usually 136 faster, than the algorithms for rendering polygons. 137 But the opposite can be expected for graphic pipelines 138 that can make use of hardware acceleration. 139 140 The default setting is AutoCache 141 142 \sa setCachePolicy(), cachePolicy() 143 144 \note The policy has no effect, when the symbol is painted 130 Depending on the render engine and the complexity of the 131 symbol shape it might be faster to render the symbol 132 to a pixmap and to paint this pixmap. 133 134 F.e. the raster paint engine is a pure software renderer 135 where in cache mode a draw operation usually ends in 136 raster operation with the the backing store, that are usually 137 faster, than the algorithms for rendering polygons. 138 But the opposite can be expected for graphic pipelines 139 that can make use of hardware acceleration. 140 141 The default setting is AutoCache 142 143 \sa setCachePolicy(), cachePolicy() 144 145 \note The policy has no effect, when the symbol is painted 145 146 to a vector graphics format ( PDF, SVG ). 146 \warning Since Qt 4.8 raster is the default backend on X11 147 \warning Since Qt 4.8 raster is the default backend on X11 147 148 */ 148 149 … … 164 165 }; 165 166 166 public: 167 QwtSymbol( Style = NoSymbol ); 168 QwtSymbol( Style, const QBrush &, const QPen&, const QSize& );169 QwtSymbol( const QPainterPath &, const QBrush&, const QPen& );167 public: 168 explicit QwtSymbol( Style = NoSymbol ); 169 QwtSymbol( Style, const QBrush&, const QPen&, const QSize& ); 170 QwtSymbol( const QPainterPath&, const QBrush&, const QPen& ); 170 171 171 172 virtual ~QwtSymbol(); … … 174 175 CachePolicy cachePolicy() const; 175 176 176 void setSize( const QSize & );177 void setSize( const QSize& ); 177 178 void setSize( int width, int height = -1 ); 178 const QSize &size() const;179 180 void setPinPoint( const QPointF &pos, bool enable = true );179 const QSize& size() const; 180 181 void setPinPoint( const QPointF& pos, bool enable = true ); 181 182 QPointF pinPoint() const; 182 183 … … 184 185 bool isPinPointEnabled() const; 185 186 186 virtual void setColor( const QColor & );187 188 void setBrush( const QBrush & );189 const QBrush &brush() const;190 191 void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );192 void setPen( const QPen & );193 const QPen &pen() const;187 virtual void setColor( const QColor& ); 188 189 void setBrush( const QBrush& ); 190 const QBrush& brush() const; 191 192 void setPen( const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine ); 193 void setPen( const QPen& ); 194 const QPen& pen() const; 194 195 195 196 void setStyle( Style ); 196 197 Style style() const; 197 198 198 void setPath( const QPainterPath & );199 const QPainterPath &path() const;200 201 void setPixmap( const QPixmap & );202 const QPixmap &pixmap() const;203 204 void setGraphic( const QwtGraphic & );205 const QwtGraphic &graphic() const;199 void setPath( const QPainterPath& ); 200 const QPainterPath& path() const; 201 202 void setPixmap( const QPixmap& ); 203 const QPixmap& pixmap() const; 204 205 void setGraphic( const QwtGraphic& ); 206 const QwtGraphic& graphic() const; 206 207 207 208 #ifndef QWT_NO_SVG 208 void setSvgDocument( const QByteArray & );209 void setSvgDocument( const QByteArray& ); 209 210 #endif 210 211 211 void drawSymbol( QPainter *, const QRectF& ) const;212 void drawSymbol( QPainter *, const QPointF& ) const;213 void drawSymbols( QPainter *, const QPolygonF& ) const;214 void drawSymbols( QPainter *,215 const QPointF *, int numPoints ) const;212 void drawSymbol( QPainter*, const QRectF& ) const; 213 void drawSymbol( QPainter*, const QPointF& ) const; 214 void drawSymbols( QPainter*, const QPolygonF& ) const; 215 void drawSymbols( QPainter*, 216 const QPointF*, int numPoints ) const; 216 217 217 218 virtual QRect boundingRect() const; 218 219 void invalidateCache(); 219 220 220 protected: 221 virtual void renderSymbols( QPainter *, 222 const QPointF *, int numPoints ) const; 223 224 private: 225 // Disabled copy constructor and operator= 226 QwtSymbol( const QwtSymbol & ); 227 QwtSymbol &operator=( const QwtSymbol & ); 221 protected: 222 virtual void renderSymbols( QPainter*, 223 const QPointF*, int numPoints ) const; 224 225 private: 226 Q_DISABLE_COPY(QwtSymbol) 228 227 229 228 class PrivateData; 230 PrivateData *d_data;229 PrivateData* m_data; 231 230 }; 232 231 233 232 /*! 234 \brief Draw the symbol at a specified position 235 236 \param painter Painter 237 \param pos Position of the symbol in screen coordinates 238 */ 233 \brief Draw the symbol at a specified position 234 235 \param painter Painter 236 \param pos Position of the symbol in screen coordinates 237 */ 239 238 inline void QwtSymbol::drawSymbol( 240 QPainter *painter, const QPointF&pos ) const239 QPainter* painter, const QPointF& pos ) const 241 240 { 242 241 drawSymbols( painter, &pos, 1 ); … … 244 243 245 244 /*! 246 \brief Draw symbols at the specified points 247 248 \param painter Painter 249 \param points Positions of the symbols in screen coordinates 250 */ 245 \brief Draw symbols at the specified points 246 247 \param painter Painter 248 \param points Positions of the symbols in screen coordinates 249 */ 251 250 252 251 inline void QwtSymbol::drawSymbols( 253 QPainter *painter, const QPolygonF&points ) const252 QPainter* painter, const QPolygonF& points ) const 254 253 { 255 254 drawSymbols( painter, points.data(), points.size() );
Note:
See TracChangeset
for help on using the changeset viewer.
