~l3on/ubuntu/oneiric/qwt/fix-921430

« back to all changes in this revision

Viewing changes to qwt-5.0.1/src/qwt_plot_marker.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2007-10-05 15:20:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071005152041-qmybqh4fj9jejyo2
Tags: 5.0.2-2
* Handle nostrip build option. (Closes: #437877)
* Build libqwt5-doc package in binary-indep target. (Closes: #443110)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
// vim: expandtab
11
 
 
12
 
#ifndef QWT_PLOT_MARKER_H
13
 
#define QWT_PLOT_MARKER_H
14
 
 
15
 
#include <qpen.h>
16
 
#include <qfont.h>
17
 
#include <qstring.h>
18
 
#include <qbrush.h>
19
 
#include "qwt_global.h"
20
 
#include "qwt_plot_item.h"
21
 
 
22
 
class QRect;
23
 
class QwtText;
24
 
class QwtSymbol;
25
 
 
26
 
/*!
27
 
  \brief A class for drawing markers
28
 
 
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.
32
 
 
33
 
  The QwtPlotMarker::setSymbol() member assigns a symbol to the marker.
34
 
  The symbol is drawn at the specified point.
35
 
 
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.
43
 
*/
44
 
 
45
 
class QWT_EXPORT QwtPlotMarker: public QwtPlotItem
46
 
{
47
 
public:
48
 
 
49
 
    /*!
50
 
        Line styles.
51
 
        \sa QwtPlotMarker::setLineStyle, QwtPlotMarker::lineStyle
52
 
    */
53
 
    enum LineStyle {NoLine, HLine, VLine, Cross};
54
 
   
55
 
    explicit QwtPlotMarker();
56
 
    virtual ~QwtPlotMarker();
57
 
 
58
 
    virtual int rtti() const;
59
 
 
60
 
    double xValue() const;
61
 
    double yValue() const;
62
 
    QwtDoublePoint value() const;
63
 
 
64
 
    void setXValue(double);
65
 
    void setYValue(double);
66
 
    void setValue(double, double);
67
 
    void setValue(const QwtDoublePoint &);
68
 
 
69
 
    void setLineStyle(LineStyle st);
70
 
    LineStyle lineStyle() const;
71
 
 
72
 
    void setLinePen(const QPen &p);
73
 
    const QPen &linePen() const;
74
 
 
75
 
    void setSymbol(const QwtSymbol &s);
76
 
    const QwtSymbol &symbol() const;
77
 
 
78
 
    void setLabel(const QwtText&);
79
 
    QwtText label() const;
80
 
 
81
 
#if QT_VERSION < 0x040000
82
 
    void setLabelAlignment(int align);
83
 
    int labelAlignment() const;
84
 
#else
85
 
    void setLabelAlignment(Qt::Alignment);
86
 
    Qt::Alignment labelAlignment() const;
87
 
#endif
88
 
 
89
 
    virtual void draw(QPainter *p, 
90
 
        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
91
 
        const QRect &) const;
92
 
    
93
 
    virtual QwtDoubleRect boundingRect() const;
94
 
 
95
 
private:
96
 
    class PrivateData;
97
 
    PrivateData *d_data;
98
 
};
99
 
 
100
 
#endif