qwt_polar_grid.h
Go to the documentation of this file.
1 /******************************************************************************
2  * QwtPolar Widget Library
3  * Copyright (C) 2008 Uwe Rathmann
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the Qwt License, Version 1.0
7  *****************************************************************************/
8 
9 #ifndef QWT_POLAR_GRID_H
10 #define QWT_POLAR_GRID_H
11 
12 #include "qwt_global.h"
13 #include "qwt_polar.h"
14 #include "qwt_polar_item.h"
15 #include "qwt_polar_plot.h"
16 
17 class QPainter;
18 class QPen;
19 class QwtScaleMap;
20 class QwtScaleDiv;
21 class QwtRoundScaleDraw;
22 class QwtScaleDraw;
23 
42 {
43  public:
53  {
58  SmartOriginLabel = 1,
59 
64  HideMaxRadiusLabel = 2,
65 
72  ClipAxisBackground = 4,
73 
78  SmartScaleDraw = 8,
79 
85  ClipGridLines = 16
86  };
87 
88  Q_DECLARE_FLAGS( DisplayFlags, DisplayFlag )
89 
90 
95  {
100  AutoScaling = 0x01
101  };
102 
103  Q_DECLARE_FLAGS( GridAttributes, GridAttribute )
104 
105  explicit QwtPolarGrid();
106  virtual ~QwtPolarGrid();
107 
108  virtual int rtti() const QWT_OVERRIDE;
109 
110  void setDisplayFlag( DisplayFlag, bool on = true );
111  bool testDisplayFlag( DisplayFlag ) const;
112 
113  void setGridAttribute( GridAttribute, bool on = true );
114  bool testGridAttribute( GridAttribute ) const;
115 
116  void showGrid( int scaleId, bool show = true );
117  bool isGridVisible( int scaleId ) const;
118 
119  void showMinorGrid( int scaleId, bool show = true );
120  bool isMinorGridVisible( int scaleId ) const;
121 
122  void showAxis( int axisId, bool show = true );
123  bool isAxisVisible( int axisId ) const;
124 
125  void setPen( const QPen& p );
126  void setFont( const QFont& );
127 
128  void setMajorGridPen( const QPen& p );
129  void setMajorGridPen( int scaleId, const QPen& p );
130  QPen majorGridPen( int scaleId ) const;
131 
132  void setMinorGridPen( const QPen& p );
133  void setMinorGridPen( int scaleId, const QPen& p );
134  QPen minorGridPen( int scaleId ) const;
135 
136  void setAxisPen( int axisId, const QPen& p );
137  QPen axisPen( int axisId ) const;
138 
139  void setAxisFont( int axisId, const QFont& p );
140  QFont axisFont( int axisId ) const;
141 
142  void setScaleDraw( int axisId, QwtScaleDraw* );
143  const QwtScaleDraw* scaleDraw( int axisId ) const;
144  QwtScaleDraw* scaleDraw( int axisId );
145 
146  void setAzimuthScaleDraw( QwtRoundScaleDraw* );
147  const QwtRoundScaleDraw* azimuthScaleDraw() const;
148  QwtRoundScaleDraw* azimuthScaleDraw();
149 
150  virtual void draw( QPainter* p,
151  const QwtScaleMap& azimuthMap, const QwtScaleMap& radialMap,
152  const QPointF& pole, double radius,
153  const QRectF& rect ) const QWT_OVERRIDE;
154 
155  virtual void updateScaleDiv( const QwtScaleDiv& azimuthMap,
156  const QwtScaleDiv& radialMap, const QwtInterval& ) QWT_OVERRIDE;
157 
158  virtual int marginHint() const QWT_OVERRIDE;
159 
160  protected:
161  void drawRays( QPainter*, const QRectF&,
162  const QPointF& pole, double radius,
163  const QwtScaleMap& azimuthMap, const QList< double >& ) const;
164  void drawCircles( QPainter*, const QRectF&,
165  const QPointF& pole, const QwtScaleMap& radialMap,
166  const QList< double >& ) const;
167 
168  void drawAxis( QPainter*, int axisId ) const;
169 
170  private:
171  void updateScaleDraws(
172  const QwtScaleMap& azimuthMap, const QwtScaleMap& radialMap,
173  const QPointF& pole, const double radius ) const;
174 
175  private:
176  class PrivateData;
177  PrivateData* m_data;
178 };
179 
180 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarGrid::DisplayFlags )
181 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarGrid::GridAttributes )
182 
183 #endif
QwtRoundScaleDraw
A class for drawing round scales.
Definition: qwt_round_scale_draw.h:31
QwtScaleDraw
A class for drawing scales.
Definition: qwt_scale_draw.h:35
QwtPolarGrid::PrivateData
Definition: qwt_polar_grid.cpp:68
qwt_polar.h
QwtPolarItem::rtti
virtual int rtti() const
Definition: qwt_polar_item.cpp:112
qwt_global.h
QList
Definition: qwt_abstract_legend.h:17
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:22
QwtPolarItem
Base class for items on a polar plot.
Definition: qwt_polar_item.h:37
QwtPolarGrid
An item which draws scales and grid lines on a polar plot.
Definition: qwt_polar_grid.h:41
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:26
QwtPolarGrid::GridAttribute
GridAttribute
Grid attributes.
Definition: qwt_polar_grid.h:94
QwtPolarGrid::DisplayFlag
DisplayFlag
Definition: qwt_polar_grid.h:52
QWT_OVERRIDE
#define QWT_OVERRIDE
Definition: qwt_global.h:53
QWT_EXPORT
#define QWT_EXPORT
Definition: qwt_global.h:38
qwt_polar_item.h
qwt_polar_plot.h
QwtScaleDiv
A class representing a scale division.
Definition: qwt_scale_div.h:33


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46