QGIS API Documentation
3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
src
core
qgsmapunitscale.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmapunitscale.h
3
Struct for storing maximum and minimum scales for measurements in map units
4
-------------------
5
begin : April 2014
6
copyright : (C) Sandro Mani
7
email : smani at sourcepole dot ch
8
9
***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSMAPUNITSCALE_H
19
#define QGSMAPUNITSCALE_H
20
21
#include "
qgis.h
"
22
#include "qgis_core.h"
23
24
class
QgsRenderContext
;
25
35
36
class
CORE_EXPORT
QgsMapUnitScale
37
{
38
public
:
39
46
explicit
QgsMapUnitScale
(
double
minScale
= 0.0,
double
maxScale
= 0.0 )
47
:
minScale
(
minScale
)
48
,
maxScale
(
maxScale
)
49
{}
50
56
bool
isNull()
const
;
57
62
double
minScale
;
63
68
double
maxScale
;
69
71
bool
minSizeMMEnabled
=
false
;
73
double
minSizeMM
= 0.0;
75
bool
maxSizeMMEnabled
=
false
;
77
double
maxSizeMM
= 0.0;
78
85
double
computeMapUnitsPerPixel
(
const
QgsRenderContext
&
c
)
const
;
86
87
bool
operator==
(
const
QgsMapUnitScale
&other )
const
88
{
89
return
qgsDoubleNear
(
minScale
, other.
minScale
)
90
&&
qgsDoubleNear
(
maxScale
, other.
maxScale
)
91
&&
minSizeMMEnabled
== other.
minSizeMMEnabled
92
&&
qgsDoubleNear
(
minSizeMM
, other.
minSizeMM
)
93
&&
maxSizeMMEnabled
== other.
maxSizeMMEnabled
94
&&
qgsDoubleNear
(
maxSizeMM
, other.
maxSizeMM
);
95
}
96
97
bool
operator!=
(
const
QgsMapUnitScale
&other )
const
98
{
99
return
!
operator==
( other );
100
}
101
};
102
103
104
#endif
// QGSMAPUNITSCALE_H
105
106
107
QgsMapUnitScale::computeMapUnitsPerPixel
double computeMapUnitsPerPixel(const QgsRenderContext &c) const
Computes a map units per pixel scaling factor, respecting the minimum and maximum scales set for the ...
Definition
qgsmapunitscale.cpp:31
QgsMapUnitScale::QgsMapUnitScale
QgsMapUnitScale(double minScale=0.0, double maxScale=0.0)
Constructor for QgsMapUnitScale.
Definition
qgsmapunitscale.h:46
QgsMapUnitScale::minSizeMMEnabled
bool minSizeMMEnabled
Whether the minimum size in mm should be respected.
Definition
qgsmapunitscale.h:71
QgsMapUnitScale::maxScale
double maxScale
The maximum scale, or 0.0 if unset.
Definition
qgsmapunitscale.h:68
QgsMapUnitScale::operator!=
bool operator!=(const QgsMapUnitScale &other) const
Definition
qgsmapunitscale.h:97
QgsMapUnitScale::minScale
double minScale
The minimum scale, or 0.0 if unset.
Definition
qgsmapunitscale.h:62
QgsMapUnitScale::operator==
bool operator==(const QgsMapUnitScale &other) const
Definition
qgsmapunitscale.h:87
QgsMapUnitScale::maxSizeMM
double maxSizeMM
The maximum size in millimeters, or 0.0 if unset.
Definition
qgsmapunitscale.h:77
QgsMapUnitScale::maxSizeMMEnabled
bool maxSizeMMEnabled
Whether the maximum size in mm should be respected.
Definition
qgsmapunitscale.h:75
QgsMapUnitScale::minSizeMM
double minSizeMM
The minimum size in millimeters, or 0.0 if unset.
Definition
qgsmapunitscale.h:73
QgsRenderContext
Contains information about the context of a rendering operation.
Definition
qgsrendercontext.h:63
c
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
Definition
porting_processing.dox:1
qgis.h
qgsDoubleNear
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference).
Definition
qgis.h:6607
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:433
Generated on
for QGIS API Documentation by
1.15.0