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
*****************************************************************************/
12
#ifndef QWT_PLOT_MARKER_H
13
#define QWT_PLOT_MARKER_H
19
#include "qwt_global.h"
20
#include "qwt_plot_item.h"
27
\brief A class for drawing markers
29
A marker can be a horizontal line, a vertical line,
30
a symbol, a label or any combination of them, which can
31
be drawn around a center point inside a bounding rectangle.
33
The QwtPlotMarker::setSymbol() member assigns a symbol to the marker.
34
The symbol is drawn at the specified point.
36
With QwtPlotMarker::setLabel(), a label can be assigned to the marker.
37
The QwtPlotMarker::setLabelAlignment() member specifies where the label is
38
drawn. All the Align*-constants in Qt::AlignmentFlags (see Qt documentation)
39
are valid. The interpretation of the alignment depends on the marker's
40
line style. The alignment refers to the center point of
41
the marker, which means, for example, that the label would be printed
42
left above the center point if the alignment was set to AlignLeft|AlignTop.
45
class QWT_EXPORT QwtPlotMarker: public QwtPlotItem
51
\sa QwtPlotMarker::setLineStyle, QwtPlotMarker::lineStyle
53
enum LineStyle {NoLine, HLine, VLine, Cross};
55
explicit QwtPlotMarker();
56
virtual ~QwtPlotMarker();
58
virtual int rtti() const;
60
double xValue() const;
61
double yValue() const;
62
QwtDoublePoint value() const;
64
void setXValue(double);
65
void setYValue(double);
66
void setValue(double, double);
67
void setValue(const QwtDoublePoint &);
69
void setLineStyle(LineStyle st);
70
LineStyle lineStyle() const;
72
void setLinePen(const QPen &p);
73
const QPen &linePen() const;
75
void setSymbol(const QwtSymbol &s);
76
const QwtSymbol &symbol() const;
78
void setLabel(const QwtText&);
79
QwtText label() const;
81
#if QT_VERSION < 0x040000
82
void setLabelAlignment(int align);
83
int labelAlignment() const;
85
void setLabelAlignment(Qt::Alignment);
86
Qt::Alignment labelAlignment() const;
89
virtual void draw(QPainter *p,
90
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
93
virtual QwtDoubleRect boundingRect() const;