Loading...
Searching...
No Matches
qwt_polar_grid.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_GRID_H
#define QWT_POLAR_GRID_H
#include "qwt_global.h"
#include "qwt_polar.h"
#include "qwt_polar_item.h"
#include "qwt_polar_plot.h"
class QPainter;
class QPen;
class QwtScaleMap;
class QwtScaleDiv;
class QwtRoundScaleDraw;
class QwtScaleDraw;
class QWT_EXPORT QwtPolarGrid : public QwtPolarItem
{
public:
enum DisplayFlag
{
SmartOriginLabel = 1,
HideMaxRadiusLabel = 2,
ClipAxisBackground = 4,
SmartScaleDraw = 8,
ClipGridLines = 16
};
Q_DECLARE_FLAGS( DisplayFlags, DisplayFlag )
enum GridAttribute
{
AutoScaling = 0x01
};
Q_DECLARE_FLAGS( GridAttributes, GridAttribute )
explicit QwtPolarGrid();
virtual ~QwtPolarGrid();
virtual int rtti() const QWT_OVERRIDE;
void setDisplayFlag( DisplayFlag, bool on = true );
bool testDisplayFlag( DisplayFlag ) const;
void setGridAttribute( GridAttribute, bool on = true );
bool testGridAttribute( GridAttribute ) const;
void showGrid( int scaleId, bool show = true );
bool isGridVisible( int scaleId ) const;
void showMinorGrid( int scaleId, bool show = true );
bool isMinorGridVisible( int scaleId ) const;
void showAxis( int axisId, bool show = true );
bool isAxisVisible( int axisId ) const;
void setPen( const QPen& p );
void setFont( const QFont& );
void setMajorGridPen( const QPen& p );
void setMajorGridPen( int scaleId, const QPen& p );
QPen majorGridPen( int scaleId ) const;
void setMinorGridPen( const QPen& p );
void setMinorGridPen( int scaleId, const QPen& p );
QPen minorGridPen( int scaleId ) const;
void setAxisPen( int axisId, const QPen& p );
QPen axisPen( int axisId ) const;
void setAxisFont( int axisId, const QFont& p );
QFont axisFont( int axisId ) const;
void setScaleDraw( int axisId, QwtScaleDraw* );
const QwtScaleDraw* scaleDraw( int axisId ) const;
QwtScaleDraw* scaleDraw( int axisId );
void setAzimuthScaleDraw( QwtRoundScaleDraw* );
const QwtRoundScaleDraw* azimuthScaleDraw() const;
QwtRoundScaleDraw* azimuthScaleDraw();
virtual void draw( QPainter* p,
const QwtScaleMap& azimuthMap, const QwtScaleMap& radialMap,
const QPointF& pole, double radius,
const QRectF& rect ) const QWT_OVERRIDE;
virtual void updateScaleDiv( const QwtScaleDiv& azimuthMap,
const QwtScaleDiv& radialMap, const QwtInterval& ) QWT_OVERRIDE;
virtual int marginHint() const QWT_OVERRIDE;
protected:
void drawRays( QPainter*, const QRectF&,
const QPointF& pole, double radius,
const QwtScaleMap& azimuthMap, const QList< double >& ) const;
void drawCircles( QPainter*, const QRectF&,
const QPointF& pole, const QwtScaleMap& radialMap,
const QList< double >& ) const;
void drawAxis( QPainter*, int axisId ) const;
private:
void updateScaleDraws(
const QwtScaleMap& azimuthMap, const QwtScaleMap& radialMap,
const QPointF& pole, const double radius ) const;
private:
class PrivateData;
PrivateData* m_data;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarGrid::DisplayFlags )
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarGrid::GridAttributes )
#endif
QList
Definition qwt_abstract_legend.h:17
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtPolarGrid
An item which draws scales and grid lines on a polar plot.
Definition qwt_polar_grid.h:42
QwtPolarGrid::GridAttribute
GridAttribute
Grid attributes.
Definition qwt_polar_grid.h:95
QwtPolarGrid::GridAttributes
QFlags< GridAttribute > GridAttributes
Definition qwt_polar_grid.h:103
QwtPolarGrid::DisplayFlags
QFlags< DisplayFlag > DisplayFlags
Definition qwt_polar_grid.h:88
QwtPolarGrid::DisplayFlag
DisplayFlag
Definition qwt_polar_grid.h:53
QwtPolarItem
Base class for items on a polar plot.
Definition qwt_polar_item.h:38
QwtPolarItem::rtti
virtual int rtti() const
Definition qwt_polar_item.cpp:112
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
QwtScaleDraw
A class for drawing scales.
Definition qwt_scale_draw.h:36
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27