QGIS API Documentation  3.20.0-Odense (decaadbb31)
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( TickPosition position = TicksMiddle );
45 
46  QString id() const override;
47  QString visibleName() const override;
48  int sortKey() const override;
49  Flags flags() const override;
50  QgsTicksScaleBarRenderer *clone() const override SIP_FACTORY;
51 
52  void draw( QgsRenderContext &context,
53  const QgsScaleBarSettings &settings,
54  const QgsScaleBarRenderer::ScaleBarContext &scaleContext ) const override;
55 
60  void setTickPosition( TickPosition position ) { mTickPosition = position; }
61 
66  TickPosition tickPosition() const { return mTickPosition; }
67 
68  private:
69 
70  TickPosition mTickPosition = TicksMiddle;
71 };
72 
73 #endif // QGSTICKSSCALEBARRENDERER_H
Contains information about the context of a rendering operation.
Abstract base class for scale bar renderers.
virtual Flags flags() const
Returns the scalebar rendering flags, which dictates the renderer's behavior.
virtual int sortKey() const
Returns a sorting key value, where renderers with a lower sort key will be shown earlier in lists.
virtual QgsScaleBarRenderer * clone() const =0
Returns a clone of the renderer.
virtual QString visibleName() const =0
Returns the user friendly, translated name for the renderer.
virtual QString id() const =0
Returns the unique ID for this renderer.
The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with Qgs...
A scale bar that draws segments using short ticks.
@ TicksUp
Render ticks above line.
@ TicksMiddle
Render ticks crossing line.
@ TicksDown
Render ticks below line.
TickPosition tickPosition() const
Returns the position for tick marks in the scalebar.
#define SIP_FACTORY
Definition: qgis_sip.h:76