qwt_symbol.h
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #ifndef QWT_SYMBOL_H
11 #define QWT_SYMBOL_H
12 
13 #include "qwt_global.h"
14 
15 #include <qpolygon.h>
16 #include <qpen.h>
17 #include <qbrush.h>
18 
19 class QPainter;
20 class QSize;
21 class QBrush;
22 class QPen;
23 class QColor;
24 class QPointF;
25 class QPainterPath;
26 class QPixmap;
27 class QByteArray;
28 class QwtGraphic;
29 
32 {
33 public:
38  enum Style
39  {
41  NoSymbol = -1,
42 
45 
48 
51 
54 
57 
60 
63 
66 
69 
72 
75 
78 
81 
84 
87 
96 
104 
112 
120 
126  UserStyle = 1000
127  };
128 
151  {
154 
157 
164  AutoCache
165  };
166 
167 public:
168  explicit QwtSymbol( Style = NoSymbol );
169  QwtSymbol( Style, const QBrush &, const QPen &, const QSize & );
170  QwtSymbol( const QPainterPath &, const QBrush &, const QPen & );
171 
172  virtual ~QwtSymbol();
173 
174  void setCachePolicy( CachePolicy );
175  CachePolicy cachePolicy() const;
176 
177  void setSize( const QSize & );
178  void setSize( int width, int height = -1 );
179  const QSize &size() const;
180 
181  void setPinPoint( const QPointF &pos, bool enable = true );
182  QPointF pinPoint() const;
183 
184  void setPinPointEnabled( bool );
185  bool isPinPointEnabled() const;
186 
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;
195 
196  void setStyle( Style );
197  Style style() const;
198 
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;
207 
208 #ifndef QWT_NO_SVG
209  void setSvgDocument( const QByteArray & );
210 #endif
211 
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;
217 
218  virtual QRect boundingRect() const;
219  void invalidateCache();
220 
221 protected:
222  virtual void renderSymbols( QPainter *,
223  const QPointF *, int numPoints ) const;
224 
225 private:
226  Q_DISABLE_COPY(QwtSymbol)
227 
228  class PrivateData;
229  PrivateData *d_data;
230 };
231 
238 inline void QwtSymbol::drawSymbol(
239  QPainter *painter, const QPointF &pos ) const
240 {
241  drawSymbols( painter, &pos, 1 );
242 }
243 
252  QPainter *painter, const QPolygonF &points ) const
253 {
254  drawSymbols( painter, points.data(), points.size() );
255 }
256 
257 #endif
Six-pointed star.
Definition: qwt_symbol.h:83
#define QWT_EXPORT
Definition: qwt_global.h:38
A class for drawing symbols.
Definition: qwt_symbol.h:31
Horizontal line.
Definition: qwt_symbol.h:74
Cross (+)
Definition: qwt_symbol.h:68
Diagonal cross (X)
Definition: qwt_symbol.h:71
Rectangle.
Definition: qwt_symbol.h:47
Triangle pointing right.
Definition: qwt_symbol.h:65
Ellipse or circle.
Definition: qwt_symbol.h:44
Don&#39;t use a pixmap cache.
Definition: qwt_symbol.h:153
A paint device for scalable graphics.
Definition: qwt_graphic.h:75
void drawSymbols(QPainter *, const QPolygonF &) const
Draw symbols at the specified points.
Definition: qwt_symbol.h:251
X combined with +.
Definition: qwt_symbol.h:80
Vertical line.
Definition: qwt_symbol.h:77
Triangle pointing upwards.
Definition: qwt_symbol.h:53
std::enable_if_t< all< Args... >::value, enable_t > enable
Definition: sol.hpp:1726
Triangle pointing upwards.
Definition: qwt_symbol.h:59
Triangle pointing left.
Definition: qwt_symbol.h:62
Always use a pixmap cache.
Definition: qwt_symbol.h:156
Triangle pointing downwards.
Definition: qwt_symbol.h:56


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10