QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsnumericscalebarrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsnumericscalebarrenderer.h
3  ----------------------------
4  begin : June 2008
5  copyright : (C) 2008 by Marco Hugentobler
6  email : [email protected]
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSNUMERICSCALEBARRENDERER_H
18 #define QGSNUMERICSCALEBARRENDERER_H
19 
20 #include "qgis_core.h"
21 #include "qgsscalebarrenderer.h"
22 #include <QString>
23 
31 {
32  public:
33 
37  QgsNumericScaleBarRenderer() = default;
38 
39  QString id() const override;
40  QString visibleName() const override;
41  int sortKey() const override;
42  Flags flags() const override;
44 
45  void draw( QgsRenderContext &context,
46  const QgsScaleBarSettings &settings,
47  const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const override;
48 
49  QSizeF calculateBoxSize( QgsRenderContext &context,
50  const QgsScaleBarSettings &settings,
51  const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const override;
52 
53  Q_DECL_DEPRECATED QSizeF calculateBoxSize( const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const override SIP_DEPRECATED ;
54 
55  private:
56 
58  QString scaleText( double scale, const QgsScaleBarSettings &settings ) const;
59 
60 };
61 
62 #endif // QGSNUMERICSCALEBARRENDERER_H
QgsScaleBarRenderer::draw
virtual void draw(QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const =0
Draws the scalebar using the specified settings and scaleContext to a destination render context.
QgsScaleBarRenderer::id
virtual QString id() const =0
Returns the unique ID for this renderer.
QgsScaleBarRenderer::ScaleBarContext
Contains parameters regarding scalebar calculations.
Definition: qgsscalebarrenderer.h:70
QgsScaleBarRenderer::clone
virtual QgsScaleBarRenderer * clone() const =0
Returns a clone of the renderer.
QgsRenderContext
Definition: qgsrendercontext.h:57
qgsscalebarrenderer.h
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsScaleBarSettings
Definition: qgsscalebarsettings.h:40
QgsScaleBarRenderer
Definition: qgsscalebarrenderer.h:38
QgsScaleBarRenderer::visibleName
virtual QString visibleName() const =0
Returns the user friendly, translated name for the renderer.
QgsScaleBarRenderer::sortKey
virtual int sortKey() const
Returns a sorting key value, where renderers with a lower sort key will be shown earlier in lists.
Definition: qgsscalebarrenderer.cpp:161
QgsScaleBarRenderer::calculateBoxSize
virtual Q_DECL_DEPRECATED QSizeF calculateBoxSize(const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const
Calculates the required box size (in millimeters) for a scalebar using the specified settings and sca...
Definition: qgsscalebarrenderer.cpp:166
QgsScaleBarRenderer::flags
virtual Flags flags() const
Returns the scalebar rendering flags, which dictates the renderer's behavior.
Definition: qgsscalebarrenderer.cpp:156
QgsNumericScaleBarRenderer
Definition: qgsnumericscalebarrenderer.h:30