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 #include <qpolygon.h>
15 
16 class QPainter;
17 class QRect;
18 class QSize;
19 class QBrush;
20 class QPen;
21 class QColor;
22 class QPointF;
23 class QPolygonF;
24 class QPainterPath;
25 class QPixmap;
26 class QByteArray;
27 class QwtGraphic;
28 
31 {
32 public:
37  enum Style
38  {
40  NoSymbol = -1,
41 
44 
47 
50 
53 
56 
59 
62 
65 
68 
71 
74 
77 
80 
83 
86 
95 
103 
111 
119 
125  UserStyle = 1000
126  };
127 
150  {
153 
156 
163  AutoCache
164  };
165 
166 public:
167  explicit QwtSymbol( Style = NoSymbol );
168  QwtSymbol( Style, const QBrush &, const QPen &, const QSize & );
169  QwtSymbol( const QPainterPath &, const QBrush &, const QPen & );
170 
171  virtual ~QwtSymbol();
172 
173  void setCachePolicy( CachePolicy );
174  CachePolicy cachePolicy() const;
175 
176  void setSize( const QSize & );
177  void setSize( int width, int height = -1 );
178  const QSize& size() const;
179 
180  void setPinPoint( const QPointF &pos, bool enable = true );
181  QPointF pinPoint() const;
182 
183  void setPinPointEnabled( bool );
184  bool isPinPointEnabled() const;
185 
186  virtual void setColor( const QColor & );
187 
188  void setBrush( const QBrush& b );
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;
194 
195  void setStyle( Style );
196  Style style() const;
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;
212  void drawSymbol( QPainter *, const QPointF & ) const;
213  void drawSymbols( QPainter *, const QPolygonF & ) const;
214  void drawSymbols( QPainter *,
215  const QPointF *, int numPoints ) const;
216 
217  virtual QRect boundingRect() const;
218  void invalidateCache();
219 
220 protected:
221  virtual void renderSymbols( QPainter *,
222  const QPointF *, int numPoints ) const;
223 
224 private:
225  Q_DISABLE_COPY(QwtSymbol)
226 
227  class PrivateData;
228  PrivateData *d_data;
229 };
230 
237 inline void QwtSymbol::drawSymbol(
238  QPainter *painter, const QPointF &pos ) const
239 {
240  drawSymbols( painter, &pos, 1 );
241 }
242 
251  QPainter *painter, const QPolygonF &points ) const
252 {
253  drawSymbols( painter, points.data(), points.size() );
254 }
255 
256 #endif
Six-pointed star.
Definition: qwt_symbol.h:82
#define QWT_EXPORT
Definition: qwt_global.h:38
A class for drawing symbols.
Definition: qwt_symbol.h:30
Horizontal line.
Definition: qwt_symbol.h:73
Cross (+)
Definition: qwt_symbol.h:67
Diagonal cross (X)
Definition: qwt_symbol.h:70
GraphId path[kMaxDeadlockPathLen]
Rectangle.
Definition: qwt_symbol.h:46
Triangle pointing right.
Definition: qwt_symbol.h:64
Ellipse or circle.
Definition: qwt_symbol.h:43
Don&#39;t use a pixmap cache.
Definition: qwt_symbol.h:152
A paint device for scalable graphics.
Definition: qwt_graphic.h:74
void drawSymbols(QPainter *, const QPolygonF &) const
Draw symbols at the specified points.
Definition: qwt_symbol.h:250
X combined with +.
Definition: qwt_symbol.h:79
Vertical line.
Definition: qwt_symbol.h:76
uintptr_t size
Triangle pointing upwards.
Definition: qwt_symbol.h:52
Triangle pointing upwards.
Definition: qwt_symbol.h:58
Triangle pointing left.
Definition: qwt_symbol.h:61
Always use a pixmap cache.
Definition: qwt_symbol.h:155
Triangle pointing downwards.
Definition: qwt_symbol.h:55


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18