# qwt_compass.h

    00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
    00002  * Qwt Widget Library
    00003  * Copyright (C) 1997   Josef Wilgen
    00004  * Copyright (C) 2002   Uwe Rathmann
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the Qwt License, Version 1.0
    00008  *****************************************************************************/
    00009
    00010 #ifndef QWT_COMPASS_H
    00011 #define QWT_COMPASS_H 1
    00012
    00013 #include "qwt_global.h"
    00014 #include "qwt_dial.h"
    00015 #include <qstring.h>
    00016 #include <qmap.h>
    00017
    00018 class QwtCompassRose;
    00019
    00031 class QWT_EXPORT QwtCompass: public QwtDial
    00032 {
    00033     Q_OBJECT
    00034
    00035 public:
    00036     explicit QwtCompass( QWidget* parent = NULL );
    00037     virtual ~QwtCompass();
    00038
    00039     void setRose( QwtCompassRose *rose );
    00040     const QwtCompassRose *rose() const;
    00041     QwtCompassRose *rose();
    00042
    00043     const QMap<double, QString> &labelMap() const;
    00044     QMap<double, QString> &labelMap();
    00045     void setLabelMap( const QMap<double, QString> &map );
    00046
    00047 protected:
    00048     virtual QwtText scaleLabel( double value ) const;
    00049
    00050     virtual void drawRose( QPainter *, const QPointF &center,
    00051         double radius, double north, QPalette::ColorGroup ) const;
    00052
    00053     virtual void drawScaleContents( QPainter *,
    00054         const QPointF &center, double radius ) const;
    00055
    00056     virtual void keyPressEvent( QKeyEvent * );
    00057
    00058 private:
    00059     void initCompass();
    00060
    00061     class PrivateData;
    00062     PrivateData *d_data;
    00063 };
    00064
    00065 #endif