QGIS API Documentation
4.0.0-Norrköping (1ddcee3d0e4)
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
:
45
explicit
QgsMapUnitScale
(
double
minScale
= 0.0,
double
maxScale
= 0.0 )
46
:
minScale
(
minScale
)
47
,
maxScale
(
maxScale
)
48
{}
49
55
bool
isNull()
const
;
56
61
double
minScale
;
62
67
double
maxScale
;
68
70
bool
minSizeMMEnabled
=
false
;
72
double
minSizeMM
= 0.0;
74
bool
maxSizeMMEnabled
=
false
;
76
double
maxSizeMM
= 0.0;
77
84
double
computeMapUnitsPerPixel
(
const
QgsRenderContext
&
c
)
const
;
85
86
bool
operator==
(
const
QgsMapUnitScale
&other )
const
87
{
88
return
qgsDoubleNear
(
minScale
, other.
minScale
)
89
&&
qgsDoubleNear
(
maxScale
, other.
maxScale
)
90
&&
minSizeMMEnabled
== other.
minSizeMMEnabled
91
&&
qgsDoubleNear
(
minSizeMM
, other.
minSizeMM
)
92
&&
maxSizeMMEnabled
== other.
maxSizeMMEnabled
93
&&
qgsDoubleNear
(
maxSizeMM
, other.
maxSizeMM
);
94
}
95
96
bool
operator!=
(
const
QgsMapUnitScale
&other )
const
{
return
!
operator==
( other ); }
97
};
98
99
100
#endif
// QGSMAPUNITSCALE_H
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:26
QgsMapUnitScale::QgsMapUnitScale
QgsMapUnitScale(double minScale=0.0, double maxScale=0.0)
Constructor for QgsMapUnitScale.
Definition
qgsmapunitscale.h:45
QgsMapUnitScale::minSizeMMEnabled
bool minSizeMMEnabled
Whether the minimum size in mm should be respected.
Definition
qgsmapunitscale.h:70
QgsMapUnitScale::maxScale
double maxScale
The maximum scale, or 0.0 if unset.
Definition
qgsmapunitscale.h:67
QgsMapUnitScale::operator!=
bool operator!=(const QgsMapUnitScale &other) const
Definition
qgsmapunitscale.h:96
QgsMapUnitScale::minScale
double minScale
The minimum scale, or 0.0 if unset.
Definition
qgsmapunitscale.h:61
QgsMapUnitScale::operator==
bool operator==(const QgsMapUnitScale &other) const
Definition
qgsmapunitscale.h:86
QgsMapUnitScale::maxSizeMM
double maxSizeMM
The maximum size in millimeters, or 0.0 if unset.
Definition
qgsmapunitscale.h:76
QgsMapUnitScale::maxSizeMMEnabled
bool maxSizeMMEnabled
Whether the maximum size in mm should be respected.
Definition
qgsmapunitscale.h:74
QgsMapUnitScale::minSizeMM
double minSizeMM
The minimum size in millimeters, or 0.0 if unset.
Definition
qgsmapunitscale.h:72
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:6975
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:427
Generated on
for QGIS API Documentation by
1.15.0