You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.0 KiB
96 lines
2.0 KiB
15 years ago
|
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
|
||
|
* Qwt Widget Library
|
||
|
* Copyright (C) 1997 Josef Wilgen
|
||
|
* Copyright (C) 2002 Uwe Rathmann
|
||
14 years ago
|
*
|
||
15 years ago
|
* 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 <qbrush.h>
|
||
|
#include <qpen.h>
|
||
|
#include <qsize.h>
|
||
|
#include "qwt_global.h"
|
||
|
|
||
|
class QPainter;
|
||
|
class QRect;
|
||
|
|
||
|
//! A class for drawing symbols
|
||
|
class QWT_EXPORT QwtSymbol
|
||
|
{
|
||
|
public:
|
||
|
/*!
|
||
|
Style
|
||
|
\sa setStyle(), style()
|
||
|
*/
|
||
14 years ago
|
enum Style {
|
||
|
NoSymbol = -1,
|
||
15 years ago
|
|
||
14 years ago
|
Ellipse,
|
||
|
Rect,
|
||
|
Diamond,
|
||
|
Triangle,
|
||
15 years ago
|
DTriangle,
|
||
14 years ago
|
UTriangle,
|
||
|
LTriangle,
|
||
|
RTriangle,
|
||
|
Cross,
|
||
|
XCross,
|
||
|
HLine,
|
||
|
VLine,
|
||
|
Star1,
|
||
|
Star2,
|
||
|
Hexagon,
|
||
15 years ago
|
|
||
14 years ago
|
StyleCnt
|
||
15 years ago
|
};
|
||
14 years ago
|
|
||
15 years ago
|
public:
|
||
|
QwtSymbol();
|
||
|
QwtSymbol(Style st, const QBrush &bd, const QPen &pn, const QSize &s);
|
||
|
virtual ~QwtSymbol();
|
||
14 years ago
|
|
||
15 years ago
|
bool operator!=(const QwtSymbol &) const;
|
||
|
virtual bool operator==(const QwtSymbol &) const;
|
||
|
|
||
|
virtual QwtSymbol *clone() const;
|
||
|
|
||
|
void setSize(const QSize &s);
|
||
|
void setSize(int a, int b = -1);
|
||
|
void setBrush(const QBrush& b);
|
||
|
void setPen(const QPen &p);
|
||
|
void setStyle (Style s);
|
||
|
|
||
|
//! Return Brush
|
||
14 years ago
|
const QBrush& brush() const {
|
||
|
return d_brush;
|
||
|
}
|
||
15 years ago
|
//! Return Pen
|
||
14 years ago
|
const QPen& pen() const {
|
||
|
return d_pen;
|
||
|
}
|
||
15 years ago
|
//! Return Size
|
||
14 years ago
|
const QSize& size() const {
|
||
|
return d_size;
|
||
|
}
|
||
15 years ago
|
//! Return Style
|
||
14 years ago
|
Style style() const {
|
||
|
return d_style;
|
||
|
}
|
||
|
|
||
|
void draw(QPainter *p, const QPoint &pt) const;
|
||
15 years ago
|
void draw(QPainter *p, int x, int y) const;
|
||
|
virtual void draw(QPainter *p, const QRect &r) const;
|
||
|
|
||
|
private:
|
||
|
QBrush d_brush;
|
||
|
QPen d_pen;
|
||
|
QSize d_size;
|
||
|
Style d_style;
|
||
|
};
|
||
|
|
||
|
#endif
|