QGIS API Documentation
3.0.2-Girona (307d082)
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_core.h"
22
#include "
qgis.h
"
23
#include <QtCore>
24
25
class
QgsRenderContext
;
26
37
class
CORE_EXPORT
QgsMapUnitScale
38
{
39
public
:
40
47
explicit
QgsMapUnitScale
(
double
minScale = 0.0,
double
maxScale = 0.0 )
48
: minScale( minScale )
49
, maxScale( maxScale )
50
{}
51
56
double
minScale
;
57
62
double
maxScale
;
63
65
bool
minSizeMMEnabled =
false
;
67
double
minSizeMM = 0.0;
69
bool
maxSizeMMEnabled =
false
;
71
double
maxSizeMM = 0.0;
72
79
double
computeMapUnitsPerPixel(
const
QgsRenderContext
&c )
const
;
80
81
bool
operator==
(
const
QgsMapUnitScale
&other )
const
82
{
83
return
qgsDoubleNear
( minScale, other.
minScale
)
84
&&
qgsDoubleNear
( maxScale, other.
maxScale
)
85
&& minSizeMMEnabled == other.
minSizeMMEnabled
86
&&
qgsDoubleNear
( minSizeMM, other.
minSizeMM
)
87
&& maxSizeMMEnabled == other.
maxSizeMMEnabled
88
&&
qgsDoubleNear
( maxSizeMM, other.
maxSizeMM
);
89
}
90
91
bool
operator!=
(
const
QgsMapUnitScale
&other )
const
92
{
93
return
!
operator==
( other );
94
}
95
};
96
97
98
#endif // QGSMAPUNITSCALE_H
99
100
101
QgsMapUnitScale::minSizeMM
double minSizeMM
The minimum size in millimeters, or 0.0 if unset.
Definition:
qgsmapunitscale.h:67
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition:
qgsfeatureiterator.h:383
qgsDoubleNear
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference)
Definition:
qgis.h:251
QgsMapUnitScale::maxScale
double maxScale
The maximum scale, or 0.0 if unset.
Definition:
qgsmapunitscale.h:62
QgsMapUnitScale::operator!=
bool operator!=(const QgsMapUnitScale &other) const
Definition:
qgsmapunitscale.h:91
QgsMapUnitScale::minSizeMMEnabled
bool minSizeMMEnabled
Whether the minimum size in mm should be respected.
Definition:
qgsmapunitscale.h:65
QgsMapUnitScale::operator==
bool operator==(const QgsMapUnitScale &other) const
Definition:
qgsmapunitscale.h:81
QgsRenderContext
Contains information about the context of a rendering operation.
Definition:
qgsrendercontext.h:51
QgsMapUnitScale::QgsMapUnitScale
QgsMapUnitScale(double minScale=0.0, double maxScale=0.0)
Constructor for QgsMapUnitScale.
Definition:
qgsmapunitscale.h:47
QgsMapUnitScale::maxSizeMM
double maxSizeMM
The maximum size in millimeters, or 0.0 if unset.
Definition:
qgsmapunitscale.h:71
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition:
qgsmapunitscale.h:37
qgis.h
QgsMapUnitScale::minScale
double minScale
The minimum scale, or 0.0 if unset.
Definition:
qgsmapunitscale.h:56
QgsMapUnitScale::maxSizeMMEnabled
bool maxSizeMMEnabled
Whether the maximum size in mm should be respected.
Definition:
qgsmapunitscale.h:69
Generated on Sat Apr 21 2018 11:45:00 for QGIS API Documentation by
1.8.13