QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 name() const override { return QStringLiteral( "Numeric" ); }
40 
41  void draw( QgsRenderContext &context,
42  const QgsScaleBarSettings &settings,
43  const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const override;
44 
45  QSizeF calculateBoxSize( const QgsScaleBarSettings &settings,
46  const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const override;
47 
48  private:
49 
51  QString scaleText( double scale ) const;
52 
53 };
54 
55 #endif // QGSNUMERICSCALEBARRENDERER_H
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...
QString name() const override
Returns the unique name for this style.
Contains information about the context of a rendering operation.
A scale bar style that draws text in the form of &#39;1:XXXXX&#39;.
Abstract base class for scale bar renderers.
virtual 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...
The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with Qgs...
Contains parameters regarding scalebar calculations.