QGIS API Documentation
3.0.2-Girona (307d082)
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
w
z
+
Functions
a
b
c
d
f
g
i
l
n
o
p
r
s
t
u
z
Variables
Typedefs
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
+
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Properties
a
b
c
d
e
f
h
i
l
m
n
o
p
r
s
t
u
v
x
y
z
+
Related Functions
a
c
d
e
f
g
l
m
n
o
p
q
r
s
t
v
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
u
v
w
z
+
Variables
a
d
g
h
i
l
n
p
u
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
+
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
core
scalebar
qgsscalebarrenderer.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsscalebarrenderer.h
3
---------------------
4
begin : June 2008
5
copyright : (C) 2008 by Marco Hugentobler
6
email : marco.hugentobler@karto.baug.ethz.ch
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 QGSSCALEBARRENDERER_H
18
#define QGSSCALEBARRENDERER_H
19
20
#include "qgis_core.h"
21
#include <QRectF>
22
#include <QList>
23
24
class
QgsRenderContext
;
25
class
QgsScaleBarSettings
;
26
37
class
CORE_EXPORT
QgsScaleBarRenderer
38
{
39
public
:
40
44
struct
ScaleBarContext
45
{
47
double
segmentWidth { 0.0 };
48
54
QSizeF
size
;
55
57
double
scale { 1.0 };
58
59
};
60
64
QgsScaleBarRenderer
() =
default
;
65
virtual
~
QgsScaleBarRenderer
() =
default
;
66
70
virtual
QString name()
const
= 0;
71
75
virtual
void
draw(
QgsRenderContext
&context,
76
const
QgsScaleBarSettings
&settings,
77
const
QgsScaleBarRenderer::ScaleBarContext
&scaleContext )
const
= 0;
78
82
virtual
QSizeF calculateBoxSize(
const
QgsScaleBarSettings
&settings,
83
const
QgsScaleBarRenderer::ScaleBarContext
&scaleContext )
const
;
84
85
protected
:
86
90
void
drawDefaultLabels(
QgsRenderContext
&context,
91
const
QgsScaleBarSettings
&settings,
92
const
QgsScaleBarRenderer::ScaleBarContext
&scaleContext )
const
;
93
97
QString firstLabelString(
const
QgsScaleBarSettings
&settings )
const
;
98
102
double
firstLabelXOffset(
const
QgsScaleBarSettings
&settings )
const
;
103
107
QList<double> segmentPositions(
const
QgsScaleBarRenderer::ScaleBarContext
&scaleContext,
const
QgsScaleBarSettings
&settings )
const
;
108
112
QList<double> segmentWidths(
const
QgsScaleBarRenderer::ScaleBarContext
&scaleContext,
const
QgsScaleBarSettings
&settings )
const
;
113
114
};
115
116
#endif //QGSSCALEBARRENDERER_H
QgsScaleBarRenderer::ScaleBarContext::size
QSizeF size
Destination size for scalebar.
Definition:
qgsscalebarrenderer.h:54
QgsRenderContext
Contains information about the context of a rendering operation.
Definition:
qgsrendercontext.h:51
QgsScaleBarRenderer
Abstract base class for scale bar renderers.
Definition:
qgsscalebarrenderer.h:37
QgsScaleBarSettings
The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with Qgs...
Definition:
qgsscalebarsettings.h:35
QgsScaleBarRenderer::ScaleBarContext
Contains parameters regarding scalebar calculations.
Definition:
qgsscalebarrenderer.h:44
Generated on Sat Apr 21 2018 11:45:00 for QGIS API Documentation by
1.8.13