QGIS API Documentation  3.0.2-Girona (307d082)
qgsticksscalebarrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsticksscalebarrenderer.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 QGSTICKSSCALEBARRENDERER_H
18 #define QGSTICKSSCALEBARRENDERER_H
19 
20 #include "qgis_core.h"
21 #include "qgsscalebarrenderer.h"
22 
30 {
31  public:
32 
35  {
39  };
40 
44  QgsTicksScaleBarRenderer() = default;
45 
46  QString name() const override;
47 
48  void draw( QgsRenderContext &context,
49  const QgsScaleBarSettings &settings,
50  const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const override;
51 
56  void setTickPosition( TickPosition position ) { mTickPosition = position; }
57 
62  TickPosition tickPosition() const { return mTickPosition; }
63 
64  private:
65 
66  TickPosition mTickPosition = TicksMiddle;
67 };
68 
69 #endif // QGSTICKSSCALEBARRENDERER_H
A scale bar that draws segments using short ticks.
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...
void setTickPosition(TickPosition position)
Sets the position for tick marks in the scalebar.
TickPosition tickPosition() const
Returns the position for tick marks in the scalebar.
virtual QString name() const =0
Returns the unique name for this style.
Contains information about the context of a rendering operation.
Abstract base class for scale bar renderers.
The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with Qgs...
Contains parameters regarding scalebar calculations.