qwt_symbol.h
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_SYMBOL_H
#define QWT_SYMBOL_H
#include "qwt_global.h"
#include <qpolygon.h>
class QPainter;
class QRect;
class QSize;
class QBrush;
class QPen;
class QColor;
class QPointF;
class QPolygonF;
class QPainterPath;
class QPixmap;
class QByteArray;
class QwtGraphic;
class QWT_EXPORT QwtSymbol
{
public:
enum Style
{
NoSymbol = -1,
Ellipse,
Rect,
Diamond,
Triangle,
DTriangle,
UTriangle,
LTriangle,
RTriangle,
Cross,
XCross,
HLine,
VLine,
Star1,
Star2,
Hexagon,
Path,
Pixmap,
Graphic,
SvgDocument,
UserStyle = 1000
};
enum CachePolicy
{
NoCache,
Cache,
AutoCache
};
public:
QwtSymbol( Style = NoSymbol );
QwtSymbol( Style, const QBrush &, const QPen &, const QSize & );
QwtSymbol( const QPainterPath &, const QBrush &, const QPen & );
virtual ~QwtSymbol();
void setCachePolicy( CachePolicy );
CachePolicy cachePolicy() const;
void setSize( const QSize & );
void setSize( int width, int height = -1 );
const QSize &size() const;
void setPinPoint( const QPointF &pos, bool enable = true );
QPointF pinPoint() const;
void setPinPointEnabled( bool );
bool isPinPointEnabled() const;
virtual void setColor( const QColor & );
void setBrush( const QBrush & );
const QBrush &brush() const;
void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
void setPen( const QPen & );
const QPen &pen() const;
void setStyle( Style );
Style style() const;
void setPath( const QPainterPath & );
const QPainterPath &path() const;
void setPixmap( const QPixmap & );
const QPixmap &pixmap() const;
void setGraphic( const QwtGraphic & );
const QwtGraphic &graphic() const;
#ifndef QWT_NO_SVG
void setSvgDocument( const QByteArray & );
#endif
void drawSymbol( QPainter *, const QRectF & ) const;
void drawSymbol( QPainter *, const QPointF & ) const;
void drawSymbols( QPainter *, const QPolygonF & ) const;
void drawSymbols( QPainter *,
const QPointF *, int numPoints ) const;
virtual QRect boundingRect() const;
void invalidateCache();
protected:
virtual void renderSymbols( QPainter *,
const QPointF *, int numPoints ) const;
private:
// Disabled copy constructor and operator=
QwtSymbol( const QwtSymbol & );
QwtSymbol &operator=( const QwtSymbol & );
class PrivateData;
PrivateData *d_data;
};
inline void QwtSymbol::drawSymbol(
QPainter *painter, const QPointF &pos ) const
{
drawSymbols( painter, &pos, 1 );
}
inline void QwtSymbol::drawSymbols(
QPainter *painter, const QPolygonF &points ) const
{
drawSymbols( painter, points.data(), points.size() );
}
#endif
QwtSymbol::Hexagon
Hexagon.
Definition: qwt_symbol.h:85
QwtSymbol::Star2
Six-pointed star.
Definition: qwt_symbol.h:82
QwtSymbol::Ellipse
Ellipse or circle.
Definition: qwt_symbol.h:43
QwtSymbol::HLine
Horizontal line.
Definition: qwt_symbol.h:73
QwtSymbol::UTriangle
Triangle pointing upwards.
Definition: qwt_symbol.h:58
QwtSymbol::DTriangle
Triangle pointing downwards.
Definition: qwt_symbol.h:55
QwtSymbol::Triangle
Triangle pointing upwards.
Definition: qwt_symbol.h:52
QwtSymbol::drawSymbols
void drawSymbols(QPainter *, const QPolygonF &) const
Draw symbols at the specified points.
Definition: qwt_symbol.h:252
QwtSymbol::Cross
Cross (+)
Definition: qwt_symbol.h:67
QwtSymbol
A class for drawing symbols.
Definition: qwt_symbol.h:30
QwtSymbol::drawSymbol
void drawSymbol(QPainter *, const QRectF &) const
Draw the symbol into a rectangle.
Definition: qwt_symbol.cpp:1406
QwtSymbol::Cache
Always use a pixmap cache.
Definition: qwt_symbol.h:155
QwtSymbol::SvgDocument
Definition: qwt_symbol.h:118
QwtSymbol::CachePolicy
CachePolicy
Definition: qwt_symbol.h:149
QwtSymbol::NoCache
Don&#39;t use a pixmap cache.
Definition: qwt_symbol.h:152
QwtSymbol::XCross
Diagonal cross (X)
Definition: qwt_symbol.h:70
QwtSymbol::Pixmap
Definition: qwt_symbol.h:102
QwtSymbol::Star1
X combined with +.
Definition: qwt_symbol.h:79
QwtSymbol::RTriangle
Triangle pointing right.
Definition: qwt_symbol.h:64
QwtSymbol::LTriangle
Triangle pointing left.
Definition: qwt_symbol.h:61
QwtSymbol::Rect
Rectangle.
Definition: qwt_symbol.h:46
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:74
QwtSymbol::Style
Style
Definition: qwt_symbol.h:37
QwtSymbol::Graphic
Definition: qwt_symbol.h:110
QwtSymbol::Path
Definition: qwt_symbol.h:94
QwtSymbol::VLine
Vertical line.
Definition: qwt_symbol.h:76
QwtSymbol::Diamond
Diamond.
Definition: qwt_symbol.h:49