1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
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
*****************************************************************************/
13
#include "qwt_global.h"
24
//! A class for drawing symbols
25
class QWT_EXPORT QwtSymbol
30
\sa setStyle(), style()
34
//! No Style. The symbol cannot be drawn.
46
//! Triangle pointing upwards
49
//! Triangle pointing downwards
52
//! Triangle pointing upwards
55
//! Triangle pointing left
58
//! Triangle pointing right
64
//! Diagonal cross (X)
83
Styles >= QwtSymbol::UserSymbol are reserved for derived
84
classes of QwtSymbol that overload drawSymbols() with
85
additional application specific symbol types.
91
QwtSymbol( Style = NoSymbol );
92
QwtSymbol( Style, const QBrush &, const QPen &, const QSize & );
93
QwtSymbol( const QwtSymbol & );
96
QwtSymbol &operator=( const QwtSymbol & );
97
bool operator==( const QwtSymbol & ) const;
98
bool operator!=( const QwtSymbol & ) const;
100
void setSize( const QSize & );
101
void setSize( int width, int height = -1 );
102
const QSize& size() const;
104
virtual void setColor( const QColor & );
106
void setBrush( const QBrush& b );
107
const QBrush& brush() const;
109
void setPen( const QPen & );
110
const QPen& pen() const;
112
void setStyle( Style );
115
void drawSymbol( QPainter *, const QPointF & ) const;
116
void drawSymbols( QPainter *, const QPolygonF & ) const;
118
virtual QSize boundingSize() const;
121
virtual void drawSymbols( QPainter *,
122
const QPointF *, int numPoints ) const;
130
\brief Draw the symbol at a specified position
132
\param painter Painter
133
\param pos Position of the symbol in screen coordinates
135
inline void QwtSymbol::drawSymbol(
136
QPainter *painter, const QPointF &pos ) const
138
drawSymbols( painter, &pos, 1 );
142
\brief Draw symbols at the specified points
144
\param painter Painter
145
\param points Positions of the symbols in screen coordinates
148
inline void QwtSymbol::drawSymbols(
149
QPainter *painter, const QPolygonF &points ) const
151
drawSymbols( painter, points.data(), points.size() );