~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.1.1/src/qwt_compass_rose.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2009-04-12 23:25:58 UTC
  • mfrom: (1.1.4 upstream) (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090412232558-3bl06x785yr8xm8u
Tags: 5.1.2-1
* New upstream release.
* Bump compat/debhelper to 7.
* Bump Standards-Version to 3.8.1. No changes needed.
* Invert Maintainers and Uploaders field.
* Fix lintian warnings:
  - dh_clean _k deprecated.
  - missing dependency on libc.

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
 
#ifndef QWT_COMPASS_ROSE_H
11
 
#define QWT_COMPASS_ROSE_H 1
12
 
 
13
 
#include <qpalette.h>
14
 
#include "qwt_global.h"
15
 
 
16
 
class QPainter;
17
 
 
18
 
/*!
19
 
  \brief Abstract base class for a compass rose
20
 
*/
21
 
class QWT_EXPORT QwtCompassRose
22
 
{
23
 
public:
24
 
    virtual ~QwtCompassRose() {};
25
 
 
26
 
    virtual void setPalette(const QPalette &p) { d_palette = p; }
27
 
    const QPalette &palette() const { return d_palette; }
28
 
 
29
 
    /*!
30
 
        Draw the rose
31
 
 
32
 
        \param painter Painter
33
 
        \param center Center point
34
 
        \param radius Radius of the rose
35
 
        \param north Position
36
 
        \param colorGroup Color group
37
 
     */
38
 
    virtual void draw(QPainter *painter, const QPoint &center, 
39
 
        int radius, double north, 
40
 
        QPalette::ColorGroup colorGroup = QPalette::Active) const = 0;
41
 
 
42
 
private:
43
 
    QPalette d_palette;
44
 
};
45
 
 
46
 
/*!
47
 
  \brief A simple rose for QwtCompass
48
 
*/
49
 
class QWT_EXPORT QwtSimpleCompassRose: public QwtCompassRose
50
 
{
51
 
public:
52
 
    QwtSimpleCompassRose(int numThorns = 8, int numThornLevels = -1);
53
 
 
54
 
    void setWidth(double w);
55
 
    double width() const { return d_width; }
56
 
 
57
 
    void setNumThorns(int count);
58
 
    int numThorns() const;
59
 
 
60
 
    void setNumThornLevels(int count);
61
 
    int numThornLevels() const;
62
 
 
63
 
    void setShrinkFactor(double factor) { d_shrinkFactor = factor; }
64
 
    double shrinkFactor() const { return d_shrinkFactor; }
65
 
 
66
 
    virtual void draw(QPainter *, const QPoint &center, int radius, 
67
 
        double north, QPalette::ColorGroup = QPalette::Active) const;
68
 
 
69
 
    static void drawRose(QPainter *, 
70
 
#if QT_VERSION < 0x040000
71
 
        const QColorGroup &,
72
 
#else
73
 
        const QPalette &,
74
 
#endif
75
 
        const QPoint &center, int radius, double origin, double width, 
76
 
        int numThorns, int numThornLevels, double shrinkFactor);
77
 
 
78
 
private:
79
 
    double d_width;     
80
 
    int d_numThorns;        
81
 
    int d_numThornLevels; 
82
 
    double d_shrinkFactor;
83
 
};
84
 
 
85
 
#endif // QWT_COMPASS_ROSE_H