Loading...
Searching...
No Matches
qwt_polar_plot.h
/******************************************************************************
* QwtPolar Widget Library
* Copyright (C) 2008 Uwe Rathmann
*
* 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_POLAR_PLOT_H
#define QWT_POLAR_PLOT_H
#include "qwt_global.h"
#include "qwt_polar.h"
#include "qwt_polar_itemdict.h"
#include "qwt_interval.h"
#include "qwt_scale_map.h"
#include "qwt_point_polar.h"
#include <qframe.h>
class QwtRoundScaleDraw;
class QwtScaleEngine;
class QwtScaleDiv;
class QwtTextLabel;
class QwtPolarCanvas;
class QwtPolarLayout;
class QwtAbstractLegend;
class QWT_EXPORT QwtPolarPlot : public QFrame, public QwtPolarItemDict
{
Q_OBJECT
Q_PROPERTY( QBrush plotBackground READ plotBackground WRITE setPlotBackground )
Q_PROPERTY( double azimuthOrigin READ azimuthOrigin WRITE setAzimuthOrigin )
public:
enum LegendPosition
{
LeftLegend,
RightLegend,
BottomLegend,
TopLegend,
ExternalLegend
};
explicit QwtPolarPlot( QWidget* parent = NULL );
QwtPolarPlot( const QwtText& title, QWidget* parent = NULL );
virtual ~QwtPolarPlot();
void setTitle( const QString& );
void setTitle( const QwtText& );
QwtText title() const;
QwtTextLabel* titleLabel();
const QwtTextLabel* titleLabel() const;
void setAutoReplot( bool tf = true );
bool autoReplot() const;
void setAutoScale( int scaleId );
bool hasAutoScale( int scaleId ) const;
void setScaleMaxMinor( int scaleId, int maxMinor );
int scaleMaxMinor( int scaleId ) const;
int scaleMaxMajor( int scaleId ) const;
void setScaleMaxMajor( int scaleId, int maxMajor );
QwtScaleEngine* scaleEngine( int scaleId );
const QwtScaleEngine* scaleEngine( int scaleId ) const;
void setScaleEngine( int scaleId, QwtScaleEngine* );
void setScale( int scaleId, double min, double max, double step = 0 );
void setScaleDiv( int scaleId, const QwtScaleDiv& );
const QwtScaleDiv* scaleDiv( int scaleId ) const;
QwtScaleDiv* scaleDiv( int scaleId );
QwtScaleMap scaleMap( int scaleId, double radius ) const;
QwtScaleMap scaleMap( int scaleId ) const;
void updateScale( int scaleId );
double azimuthOrigin() const;
void zoom( const QwtPointPolar&, double factor );
void unzoom();
QwtPointPolar zoomPos() const;
double zoomFactor() const;
// Canvas
QwtPolarCanvas* canvas();
const QwtPolarCanvas* canvas() const;
void setPlotBackground ( const QBrush& c );
const QBrush& plotBackground() const;
virtual void drawCanvas( QPainter*, const QRectF& ) const;
// Legend
void insertLegend( QwtAbstractLegend*,
LegendPosition = RightLegend, double ratio = -1.0 );
QwtAbstractLegend* legend();
const QwtAbstractLegend* legend() const;
void updateLegend();
void updateLegend( const QwtPolarItem* );
// Layout
QwtPolarLayout* plotLayout();
const QwtPolarLayout* plotLayout() const;
QwtInterval visibleInterval() const;
QRectF plotRect() const;
QRectF plotRect( const QRectF& ) const;
int plotMarginHint() const;
virtual QVariant itemToInfo( QwtPolarItem* ) const;
virtual QwtPolarItem* infoToItem( const QVariant& ) const;
Q_SIGNALS:
void itemAttached( QwtPolarItem* plotItem, bool on );
void legendDataChanged( const QVariant& itemInfo,
const QList< QwtLegendData >& data );
void layoutChanged();
public Q_SLOTS:
virtual void replot();
void autoRefresh();
void setAzimuthOrigin( double );
protected:
virtual bool event( QEvent* ) QWT_OVERRIDE;
virtual void resizeEvent( QResizeEvent* ) QWT_OVERRIDE;
virtual void updateLayout();
virtual void drawItems( QPainter* painter,
const QwtScaleMap& radialMap, const QwtScaleMap& azimuthMap,
const QPointF& pole, double radius,
const QRectF& canvasRect ) const;
private:
friend class QwtPolarItem;
void attachItem( QwtPolarItem*, bool );
void initPlot( const QwtText& );
class PrivateData;
PrivateData* m_data;
};
#endif
QList
Definition qwt_abstract_legend.h:17
QwtAbstractLegend
Abstract base class for legend widgets.
Definition qwt_abstract_legend.h:35
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtPointPolar
A point in polar coordinates.
Definition qwt_point_polar.h:29
QwtPolarCanvas
Canvas of a QwtPolarPlot.
Definition qwt_polar_canvas.h:28
QwtPolarItemDict
A dictionary for polar plot items.
Definition qwt_polar_itemdict.h:29
QwtPolarItem
Base class for items on a polar plot.
Definition qwt_polar_item.h:38
QwtPolarLayout
Layout class for QwtPolarPlot.
Definition qwt_polar_layout.h:24
QwtPolarPlot
A plotting widget, displaying a polar coordinate system.
Definition qwt_polar_plot.h:47
QwtPolarPlot::layoutChanged
void layoutChanged()
QwtPolarPlot::itemAttached
void itemAttached(QwtPolarItem *plotItem, bool on)
QwtPolarPlot::legendDataChanged
void legendDataChanged(const QVariant &itemInfo, const QList< QwtLegendData > &data)
QwtPolarPlot::LegendPosition
LegendPosition
Definition qwt_polar_plot.h:60
QwtPolarPlot::BottomLegend
@ BottomLegend
The legend will be below the canvas.
Definition qwt_polar_plot.h:68
QwtPolarPlot::LeftLegend
@ LeftLegend
The legend will be left from the canvas.
Definition qwt_polar_plot.h:62
QwtPolarPlot::TopLegend
@ TopLegend
The legend will be between canvas and title.
Definition qwt_polar_plot.h:71
QwtPolarPlot::RightLegend
@ RightLegend
The legend will be right from the canvas.
Definition qwt_polar_plot.h:65
QwtRoundScaleDraw
A class for drawing round scales.
Definition qwt_round_scale_draw.h:32
QwtScaleDiv
A class representing a scale division.
Definition qwt_scale_div.h:34
QwtScaleEngine
Base class for scale engines.
Definition qwt_scale_engine.h:46
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtText
A class representing a text.
Definition qwt_text.h:52
QwtTextLabel
A Widget which displays a QwtText.
Definition qwt_text_label.h:27