Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_symbol.h
- Timestamp:
- May 10, 2017, 3:20:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_symbol.h
r4271 r8127 12 12 13 13 #include "qwt_global.h" 14 #include < QPolygonF>14 #include <qpolygon.h> 15 15 16 16 class QPainter; … … 21 21 class QColor; 22 22 class QPointF; 23 class QPolygonF; 24 class QPainterPath; 25 class QPixmap; 26 class QByteArray; 27 class QwtGraphic; 23 28 24 29 //! A class for drawing symbols … … 81 86 82 87 /*! 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() 93 */ 94 Path, 95 96 /*! 97 The symbol is represented by a pixmap. The pixmap is centered 98 or aligned to its pin point. 99 100 \sa setPinPoint() 101 */ 102 Pixmap, 103 104 /*! 105 The symbol is represented by a graphic. The graphic is centered 106 or aligned to its pin point. 107 108 \sa setPinPoint() 109 */ 110 Graphic, 111 112 /*! 113 The symbol is represented by a SVG graphic. The graphic is centered 114 or aligned to its pin point. 115 116 \sa setPinPoint() 117 */ 118 SvgDocument, 119 120 /*! 83 121 Styles >= QwtSymbol::UserSymbol are reserved for derived 84 122 classes of QwtSymbol that overload drawSymbols() with … … 88 126 }; 89 127 128 /*! 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 145 to a vector graphics format ( PDF, SVG ). 146 \warning Since Qt 4.8 raster is the default backend on X11 147 */ 148 149 enum CachePolicy 150 { 151 //! Don't use a pixmap cache 152 NoCache, 153 154 //! Always use a pixmap cache 155 Cache, 156 157 /*! 158 Use a cache when one of the following conditions is true: 159 160 - The symbol is rendered with the software 161 renderer ( QPaintEngine::Raster ) 162 */ 163 AutoCache 164 }; 165 90 166 public: 91 167 QwtSymbol( Style = NoSymbol ); 92 168 QwtSymbol( Style, const QBrush &, const QPen &, const QSize & ); 93 QwtSymbol( const QwtSymbol & ); 169 QwtSymbol( const QPainterPath &, const QBrush &, const QPen & ); 170 94 171 virtual ~QwtSymbol(); 95 172 96 QwtSymbol &operator=( const QwtSymbol & ); 97 bool operator==( const QwtSymbol & ) const; 98 bool operator!=( const QwtSymbol & ) const; 173 void setCachePolicy( CachePolicy ); 174 CachePolicy cachePolicy() const; 99 175 100 176 void setSize( const QSize & ); … … 102 178 const QSize& size() const; 103 179 180 void setPinPoint( const QPointF &pos, bool enable = true ); 181 QPointF pinPoint() const; 182 183 void setPinPointEnabled( bool ); 184 bool isPinPointEnabled() const; 185 104 186 virtual void setColor( const QColor & ); 105 187 … … 107 189 const QBrush& brush() const; 108 190 191 void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine ); 109 192 void setPen( const QPen & ); 110 193 const QPen& pen() const; … … 113 196 Style style() const; 114 197 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; 206 207 #ifndef QWT_NO_SVG 208 void setSvgDocument( const QByteArray & ); 209 #endif 210 211 void drawSymbol( QPainter *, const QRectF & ) const; 115 212 void drawSymbol( QPainter *, const QPointF & ) const; 116 213 void drawSymbols( QPainter *, const QPolygonF & ) const; 117 118 virtual QSize boundingSize() const; 214 void drawSymbols( QPainter *, 215 const QPointF *, int numPoints ) const; 216 217 virtual QRect boundingRect() const; 218 void invalidateCache(); 119 219 120 220 protected: 121 virtual void drawSymbols( QPainter *,221 virtual void renderSymbols( QPainter *, 122 222 const QPointF *, int numPoints ) const; 123 223 124 224 private: 225 // Disabled copy constructor and operator= 226 QwtSymbol( const QwtSymbol & ); 227 QwtSymbol &operator=( const QwtSymbol & ); 228 125 229 class PrivateData; 126 230 PrivateData *d_data;
Note:
See TracChangeset
for help on using the changeset viewer.